chenfang 12 months ago
parent
commit
2eb327041a
  1. 7
      src/api/wms/package/index.ts
  2. 17
      src/api/wms/transferissueJobMain/index.ts
  3. 3
      src/api/wms/transferissueRequestDetail/index.ts
  4. 40
      src/api/wms/transferissueRequestMain/index.ts
  5. 99
      src/components/BasicForm/src/BasicForm.vue
  6. 11
      src/components/Detail/src/Detail.vue
  7. 3
      src/components/DetailCountPlan/index.ts
  8. 499
      src/components/DetailCountPlan/src/DetailCountPlan.vue
  9. 9
      src/components/TableForm/src/TableForm.vue
  10. 3
      src/components/TableFormCountPlan/index.ts
  11. 193
      src/components/TableFormCountPlan/src/TableFormCountPlan.vue
  12. 18
      src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts
  13. 147
      src/views/wms/countManage/count/countPlanMain/index.vue
  14. 41
      src/views/wms/inventoryjobManage/transferissue/transferissueJobMain/index.vue
  15. 118
      src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue
  16. 115
      src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts
  17. 151
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  18. 296
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts
  19. 887
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

7
src/api/wms/package/index.ts

@ -83,4 +83,9 @@ export const exportPackage = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/package/get-import-template' }) return request.download({ url: '/wms/package/get-import-template' })
} }
// 创建标签
export const createPackageLabel = async (data: PackageVO) => {
return await request.post({ url: `/wms/package/createLabel`, data })
}

17
src/api/wms/transferissueJobMain/index.ts

@ -83,4 +83,19 @@ export const exportTransferissueJobMain = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/transferissue-job-main/get-import-template' }) return request.download({ url: '/wms/transferissue-job-main/get-import-template' })
} }
// 关闭-调拨出库任务主
export const closeTransferissueJobMain = (id: number) => {
return request.download({ url: '/wms/transferissue-job-main/close?id=' + id })
}
// 承接-调拨出库任务主
export const acceptTransferissueJobMain = (id: number) => {
return request.download({ url: '/wms/transferissue-job-main/accept?id=' + id })
}
// 放弃-调拨出库任务主
export const abandonTransferissueJobMain = (id: number) => {
return request.download({ url: '/wms/transferissue-job-main/abandon?id=' + id })
}

3
src/api/wms/transferissueRequestDetail/index.ts

@ -21,6 +21,7 @@ export interface TransferissueRequestDetailVO {
updateTime: Date updateTime: Date
updater: string updater: string
fromOwnerCode: string fromOwnerCode: string
fromLocationCode: string
} }
// 查询调拨出库申请子列表 // 查询调拨出库申请子列表
@ -62,4 +63,4 @@ export const exportTransferissueRequestDetail = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/transferissue-request-detail/get-import-template' }) return request.download({ url: '/wms/transferissue-request-detail/get-import-template' })
} }

40
src/api/wms/transferissueRequestMain/index.ts

@ -44,22 +44,22 @@ export const getTransferissueRequestMain = async (id: number) => {
return await request.get({ url: `/wms/transferissue-request-main/get?id=` + id }) return await request.get({ url: `/wms/transferissue-request-main/get?id=` + id })
} }
// 新增调拨出库申请主 // 新增-调拨出库申请主
export const createTransferissueRequestMain = async (data: TransferissueRequestMainVO) => { export const createTransferissueRequestMain = async (data: TransferissueRequestMainVO) => {
return await request.post({ url: `/wms/transferissue-request-main/create`, data }) return await request.post({ url: `/wms/transferissue-request-main/create`, data })
} }
// 修改调拨出库申请主 // 修改-调拨出库申请主
export const updateTransferissueRequestMain = async (data: TransferissueRequestMainVO) => { export const updateTransferissueRequestMain = async (data: TransferissueRequestMainVO) => {
return await request.put({ url: `/wms/transferissue-request-main/update`, data }) return await request.put({ url: `/wms/transferissue-request-main/update`, data })
} }
// 删除调拨出库申请主 // 删除-调拨出库申请主
export const deleteTransferissueRequestMain = async (id: number) => { export const deleteTransferissueRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/transferissue-request-main/delete?id=` + id }) return await request.delete({ url: `/wms/transferissue-request-main/delete?id=` + id })
} }
// 导出调拨出库申请主 Excel // 导出-调拨出库申请主 Excel
export const exportTransferissueRequestMain = async (params) => { export const exportTransferissueRequestMain = async (params) => {
return await request.download({ url: `/wms/transferissue-request-main/export-excel`, params }) return await request.download({ url: `/wms/transferissue-request-main/export-excel`, params })
} }
@ -67,4 +67,34 @@ export const exportTransferissueRequestMain = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/transferissue-request-main/get-import-template' }) return request.download({ url: '/wms/transferissue-request-main/get-import-template' })
} }
// 关闭-调拨出库申请
export const closeTransferissueRequestMain = async (id) => {
return await request.put({ url: `/wms/transferissue-request-main/close?id=` + id })
}
// 重新添加-调拨出库申请
export const reAddTransferissueRequestMain = async (id) => {
return await request.put({ url: `/wms/transferissue-request-main/reAdd?id=` + id })
}
// 提交审批-调拨出库申请
export const submitTransferissueRequestMain = async (id) => {
return await request.put({ url: `/wms/transferissue-request-main/submit?id=` + id })
}
// 审批驳回-调拨出库申请
export const refusedTransferissueRequestMain = async (id) => {
return await request.put({ url: `/wms/transferissue-request-main/refused?id=` + id })
}
// 审批通过-调拨出库申请
export const agreeTransferissueRequestMain = async (id) => {
return await request.put({ url: `/wms/transferissue-request-main/agree?id=` + id })
}
// 处理-调拨出库申请
export const handleTransferissueRequestMain = async (id) => {
return await request.put({ url: `/wms/transferissue-request-main/handle?id=` + id })
}

99
src/components/BasicForm/src/BasicForm.vue

@ -1,5 +1,10 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="isBusiness ? '60%' : '40%'" :close-on-click-modal="false"> <Dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="isBusiness ? '60%' : '40%'"
:close-on-click-modal="false"
>
<Form <Form
ref="formRef" ref="formRef"
v-loading="formLoading" v-loading="formLoading"
@ -12,7 +17,11 @@
<crontab v-model="formSchema.crontab" /> <crontab v-model="formSchema.crontab" />
</template> </template>
<template #type="formSchema" v-if="fromeWhere == 'countPlan'"> <template #type="formSchema" v-if="fromeWhere == 'countPlan'">
<el-select v-model="formSchema.type" placeholder="选择盘点类型" @change="selectChange('type',$event)"> <el-select
v-model="formSchema.type"
placeholder="选择盘点类型"
@change="selectChange('type', $event)"
>
<el-option <el-option
v-for="dict in getStrDictOptions(DICT_TYPE.COUNT_TYPE)" v-for="dict in getStrDictOptions(DICT_TYPE.COUNT_TYPE)"
:key="dict.value" :key="dict.value"
@ -22,7 +31,7 @@
</el-select> </el-select>
</template> </template>
</Form> </Form>
<div class="table" v-if="isBusiness && formType == 'create'"> <div class="table" v-if="isBusiness && formType == 'create' && fromeWhere != 'countPlan'">
<TableForm <TableForm
ref="tableFormRef" ref="tableFormRef"
class="w-[100%]" class="w-[100%]"
@ -35,13 +44,24 @@
@tableSelectionChange="tableSelectionChange" @tableSelectionChange="tableSelectionChange"
@extendedButtonsClick="extendedButtonsClick" @extendedButtonsClick="extendedButtonsClick"
@formSelectChange="formSelectChange" @formSelectChange="formSelectChange"
@formSelectvVisibleChange = 'formSelectvVisibleChange' @formSelectvVisibleChange="formSelectvVisibleChange"
@tableSortChange="tableSortChange" @tableSortChange="tableSortChange"
@selectCallback="selectCallback" @selectCallback="selectCallback"
@handleTableSelect="handleTableSelect" @handleTableSelect="handleTableSelect"
@inpuFocus="inpuFocus" @inpuFocus="inpuFocus"
/> />
</div> </div>
<div v-if="isBusiness && formType == 'create' && fromeWhere == 'countPlan'">
<TableFormCountPlan
:tableFields="tableAllSchemas.tableFormColumns"
:tableData="tableData"
:countScopeType="countScopeType"
:tableFormRules="tableFormRules"
ref="tableFormRef"
@tableFormChange="tableFormChange"
@handleAddTable="handleAddTable"
/>
</div>
<template #footer> <template #footer>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" /> <ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
</template> </template>
@ -53,6 +73,7 @@ import { SearchTable } from '@/components/SearchTable'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ButtonBase from '@/components/XButton/src/ButtonBase.vue' import ButtonBase from '@/components/XButton/src/ButtonBase.vue'
import TableForm from '@/components/TableForm/src/TableForm.vue' import TableForm from '@/components/TableForm/src/TableForm.vue'
import TableFormCountPlan from '@/components/TableFormCountPlan/src/TableFormCountPlan.vue'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const props = defineProps({ const props = defineProps({
@ -143,6 +164,11 @@ const props = defineProps({
type: String, type: String,
required: false, required: false,
default: '' default: ''
},
countScopeType: {
type: Array,
required: false,
default: null
} }
}) })
@ -156,7 +182,9 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formRef = ref() // Ref const formRef = ref() // Ref
const formSchema = ref(props.formAllSchemas?.formSchema) const formSchema = ref(props.formAllSchemas?.formSchema)
console.log('props.formAllSchemas',props.formAllSchemas) const tableAllSchemas = ref(props.tableAllSchemas)
const tableFormRules = ref(props.tableFormRules)
console.log('tableAllSchemas', tableAllSchemas.value)
/** 弹层操作 */ /** 弹层操作 */
// formField form // formField form
@ -179,7 +207,7 @@ const opensearchTable = (
// //
if (searchCondition && searchCondition.length > 0) { if (searchCondition && searchCondition.length > 0) {
// //
let filters:any[] = [] let filters: any[] = []
searchCondition.forEach((item) => { searchCondition.forEach((item) => {
// row // row
// 20231127 row[item.value]?row[item.value] row?row[item.value] 'null' // 20231127 row[item.value]?row[item.value] row?row[item.value] 'null'
@ -348,14 +376,15 @@ const emit = defineEmits([
'searchTableSuccess', 'searchTableSuccess',
'opensearchTable', 'opensearchTable',
'submitForm', 'submitForm',
'selectChange' 'selectChange',
'tableFormChange'
]) ])
// //
const formSelectChange = (field, val,row) => { const formSelectChange = (field, val, row) => {
emit('formSelectChange', field, val,row) emit('formSelectChange', field, val, row)
} }
const formSelectvVisibleChange = (field, val,row) => { const formSelectvVisibleChange = (field, val, row) => {
emit('formSelectvVisibleChange', field, val,row) emit('formSelectvVisibleChange', field, val, row)
} }
// selection // selection
const tableSelectionChange = (val) => { const tableSelectionChange = (val) => {
@ -385,8 +414,6 @@ const handleAddTable = () => {
} }
// //
const inpuFocus = (headerItem, row, index) => { const inpuFocus = (headerItem, row, index) => {
console.log(headerItem.tableForm.multiple)
opensearchTable( opensearchTable(
headerItem.field, headerItem.field,
headerItem.tableForm.searchField, headerItem.tableForm.searchField,
@ -399,16 +426,56 @@ const inpuFocus = (headerItem, row, index) => {
row row
) )
} }
// //
const selectChange=((field,val)=>{ const selectChange = (field, val) => {
emit('selectChange',field,val) emit('selectChange', field, val)
}) }
const tableFormChange = (field, val, row) => {
emit('tableFormChange', field, val, row)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.table { .table {
border: 1px solid #dedede; border: 1px solid #dedede;
border-radius: 8px; border-radius: 8px;
padding: 10px; padding: 10px;
width: calc(100% - 20px);
display: flex; display: flex;
} }
::v-deep(.el-table__body) {
padding: 10px 0px;
}
::v-deep(.el-table--default .el-table__cell) {
padding: 2px 0px;
border: none;
}
::v-deep(.el-table td.el-table__cell .el-form-item__content) {
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
::v-deep(.el-table td.el-table__cell div) {
overflow: visible;
}
::v-deep(.el-icon) {
display: block;
}button
.button {
> div {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
> div {
margin-left: 6px;
text-decoration: underline;
color: #409eff;
}
}
}
</style> </style>

11
src/components/Detail/src/Detail.vue

@ -46,7 +46,7 @@
:columns="2" :columns="2"
/> />
<Table <Table
v-if="!isBasic" v-if="!isBasic && fromeWhere != 'countPlan'"
:columns="detailAllSchemasRef.tableColumns" :columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList" :data="tableObjectRef.tableList"
:loading="tableObjectRef.loading" :loading="tableObjectRef.loading"
@ -61,6 +61,7 @@
/> />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<ContentWrap class="w-[27%] ml-16px"> <ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 --> <!-- 附件组件 -->
@ -180,7 +181,13 @@ const props = defineProps({
type: Function, type: Function,
required: false, required: false,
default: null default: null
} },
// countPlan
fromeWhere: {
type: String,
required: false,
default: ''
},
}) })
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
const detailLoading = ref(false) const detailLoading = ref(false)

3
src/components/DetailCountPlan/index.ts

@ -0,0 +1,3 @@
import DetailCountPlan from './src/DetailCountPlan.vue'
export { DetailCountPlan }

499
src/components/DetailCountPlan/src/DetailCountPlan.vue

@ -0,0 +1,499 @@
<template>
<div>
<el-drawer
v-model="isShowDrawer"
title="详情"
direction="rtl"
size="80%"
v-loading="detailLoading"
>
<template #header>
<div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div>
</template>
<ContentWrap v-if="!isBasic">
<Descriptions
:data="detailData"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" />
<div class="flex">
<!-- 详情 -->
<ContentWrap class="w-[73%]">
<!-- 列表头部 -->
<TableHead
v-if="!isBasic"
:HeadButttondata="HeadButttondata"
:masterId="masterParmas.masterId"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@searchFormClick="searchFormClick"
:allSchemas="detailAllSchemas"
/>
<Descriptions
v-if="isBasic"
:data="detailData"
:schema="allSchemas.detailSchema"
:columns="2"
/>
<Table
v-if="!isBasic"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
>
<template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 -->
<Annex
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
/>
<!-- 备注组件 -->
<Remarks
:remarksData="remarksData"
class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess"
/>
<!-- 变更记录组件 -->
<ChangeRecord :changeRecordData="changeRecordData" class="mt-20px" />
</ContentWrap>
</div>
</el-drawer>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="submitForm"
:rules="detailAllSchemasRules"
:formAllSchemas="detailAllSchemas"
:isBusiness="false"
:apiUpdate="apiUpdate"
:apiCreate="apiCreate"
@searchTableSuccess="searchTableSuccess"
:detailData="detailData"
@submitForm="submitForm"
/>
</div>
</template>
<script lang="ts" setup>
import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import Tabs from '@/components/Tabs/src/Tabs.vue'
import * as RemarkApi from '@/api/wms/remark'
import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'
defineOptions({ name: 'DetailCountPlan' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
const props = defineProps({
//
tabs: {
type: Object,
required: true,
default: null
},
//
isBasic: {
type: Boolean,
required: false,
default: false
},
//
allSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemas: {
type: Object,
required: true,
default: null
},
//
detailAllSchemasRules: {
type: Object,
required: true,
default: null
},
// API
apiCreate: {
type: Function,
required: false,
default: null
},
// API
apiUpdate: {
type: Function,
required: false,
default: null
},
// API
apiPage: {
type: Function,
required: false,
default: null
},
// API
apiDelete: {
type: Function,
required: false,
default: null
},
//
detailValidate: {
type: Function,
required: false,
default: null
}
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
if (props.isBasic == true) {
if (tabsList.value && tabsList.value.length > 0) {
tabsList.value.unshift({
label: '详情',
prop: 'Detail'
})
}
} else {
if (tabsList.value && tabsList.value.length > 0) {
} else {
tabsList.value = [
{
label: '明细',
prop: 'Detail'
}
]
}
}
if (tabsList.value) {
}
//
const annexData = reactive({
annexList: []
})
//
const remarksData = reactive({
remarksList: [],
data: {}
})
//
const changeRecordData = reactive({
changeRecordList: []
})
const detailData = ref({}) //
//
const getFileList = async () => {
detailLoading.value = true
try {
annexData.annexList = await FileApi.getFileList(remarksData.data)
} finally {
detailLoading.value = false
}
}
/** 添加附件 */
const handleAnnexSuccess = () => {
getFileList()
getChangeRecordList()
}
//
const deleteAnnexSuccess = async () => {
getFileList()
getChangeRecordList()
}
// Tabs
const current = ref(0)
const change = (item, index) => {
current.value = index
emit('changeTabs', item)
}
//
const masterParmas = ref({
masterId: '', //id
number: '', //
status: '' //
})
//
const HeadButttondata = ref()
// -
const buttondata = ref()
/** 打开弹窗 */
const titleNameRef = ref()
const titleValueRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
remarksData.data = {
tableId: row.id,
tableName: tableName
}
//
if (!props.isBasic) {
// id
masterParmas.value.masterId = row.id
masterParmas.value.number = row.number
masterParmas.value.status = row.status
tableObjectRef.value.params = {
masterId: row.id
}
getList()
}
isShowDrawer.value = true
if (row) {
detailLoading.value = true
try {
detailData.value = row
getRemarkList()
getFileList()
getChangeRecordList()
//
if(routeName.value.indexOf('Job') > -1){
HeadButttondata.value = [
defaultButtons.defaultFilterBtn(null) //
]
}else{
HeadButttondata.value = [
defaultButtons.defaultAddBtn({
hide: isShowMainButton(row, ['1'])
}), //
defaultButtons.defaultFilterBtn(null) //
]
}
//
buttondata.value = [
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1'])
}), //
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['1'])
}) //
]
} finally {
detailLoading.value = false
}
}
}
defineExpose({ openDetail }) // open
//
const getRemarkList = async () => {
detailLoading.value = true
try {
remarksData.remarksList = await RemarkApi.getRemarkPage(remarksData.data)
} finally {
detailLoading.value = false
}
}
//
const remarksSubmitScuess = async (remark) => {
detailLoading.value = false
getRemarkList()
getChangeRecordList()
}
//
const getChangeRecordList = async () => {
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data)
}
const tableObjectRef = ref()
const tableMethodsRef = ref()
const detailAllSchemasRef = ref()
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
detailAllSchemasRef.value = props.detailAllSchemas
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const { getList } = tableMethodsRef.value
//
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 updataTableColumns = (val) => {
// detailAllSchemas.tableColumns.value = val
// }
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value)
}
// form
const submitForm = async (formType, data) => {
try {
// detailValidate
const rs = await props.detailValidate?props.detailValidate(data):true
if (!rs) return
if (formType === 'create') {
await props.apiCreate(data)
message.success(t('common.createSuccess'))
} else {
await props.apiUpdate(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
}
//
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs'])
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await props.apiDelete(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
//
const searchFormClick = (searchData) => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
? searchData.filters
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }]
}
detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
tableObjectRef.value.tableList = []
const { getList } = tableMethods
getList()
// tableObjectRef.value.params = {
// isSearch: true,
// filters: searchData.filters
// ? searchData.filters
// : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }]
// }
// getList() //
}
//
watch(
() =>props.apiPage,
() => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params.masterId = masterParmas.value.masterId
detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
const { getList } = tableMethods
getList()
},
)
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

9
src/components/TableForm/src/TableForm.vue

@ -112,8 +112,7 @@
:allow-create="headerItem?.tableForm.allowCreate" :allow-create="headerItem?.tableForm.allowCreate"
style="width: 100%" style="width: 100%"
:placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label" :placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label"
@change="formSelectChange(headerItem.field, $event,row)" @change="formSelectChange(headerItem.field, $event,row)">
@visible-change="formSelectvVisibleChange(headerItem.field, $event,row)">
<el-option <el-option
v-for="op in initSelectOptions(headerItem)" v-for="op in initSelectOptions(headerItem)"
:label="op.label" :label="op.label"
@ -326,7 +325,6 @@ const emit = defineEmits([
'tableSelectionChange', 'tableSelectionChange',
'extendedButtonsClick', 'extendedButtonsClick',
'formSelectChange', 'formSelectChange',
'formSelectvVisibleChange',
'tableSortChange', 'tableSortChange',
'selectCallback', 'selectCallback',
'handleTableSelect', 'handleTableSelect',
@ -342,9 +340,7 @@ const initSelectOptions = (item) => {
const formSelectChange = (field, val,row) => { const formSelectChange = (field, val,row) => {
emit('formSelectChange', field, val,row) emit('formSelectChange', field, val,row)
} }
const formSelectvVisibleChange = (field, val,row) => {
emit('formSelectvVisibleChange', field, val,row)
}
// selection // selection
const tableSelectionChange = (val) => { const tableSelectionChange = (val) => {
emit('tableSelectionChange', val) emit('tableSelectionChange', val)
@ -381,6 +377,7 @@ const TableBaseForm_Ref = ref()
*/ */
const validateForm = () => { const validateForm = () => {
console.log(TableBaseForm_Ref.value)
let _lists = TableBaseForm_Ref.value?.map(v => v.validate()) let _lists = TableBaseForm_Ref.value?.map(v => v.validate())
return Promise.all(_lists).then(() => { return Promise.all(_lists).then(() => {
return true return true

3
src/components/TableFormCountPlan/index.ts

@ -0,0 +1,3 @@
import TableFormCountPlan from './src/TableFormCountPlan.vue'
export { TableFormCountPlan }

193
src/components/TableFormCountPlan/src/TableFormCountPlan.vue

@ -0,0 +1,193 @@
<!-- 附件组件 -->
<template>
<!-- 盘点计划的子表 -->
<div class="table">
<el-table :data="tableData" stripe style="width: 100%"
ref="TableBaseComponents_Ref" >
<el-table-column fixed="left" :width="50" v-slot="{ row, $index }">
<Icon
icon="ep:remove"
color="#757575"
size="26"
style="cursor: pointer;margin-top: -16px;"
@click="handleDeleteTable(row, $index)"
/>
</el-table-column>
<el-table-column :label="tableFields[0].label" align="center">
<template v-slot="{ row }">
<el-form
ref="TableBaseForm_Ref"
:model="row"
style="width: 100%;"
:rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'">
<el-form-item :prop="tableFields[0].field">
<el-select
v-model="row.type"
:placeholder="tableFields[0].placeholder || '请输入' + tableFields[0].label"
@change="tableFormChange(tableFields[0].field, $event, row)"
>
<el-option
v-for="dict in countScopeType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column
:prop="tableFields[1].field"
:label="tableFields[1].label"
align="center"
>
<template v-slot="{ row }">
<el-form
ref="TableBaseForm_Ref1"
:model="row"
style="width: 100%;"
:rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'">
<el-form-item :prop="tableFields[1].field">
<el-select
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
v-if="
row.type == 'OWNER' ||
row.type == 'SUPPLIER' ||
row.type == 'CUSTOMER' ||
row.type == 'ABC' ||
row.type == 'ITEMS_TYPE' ||
row.type == 'ITEMS_GROUP' ||
row.type == 'ITEMS_CODE' ||
row.type == 'WAREHOUSE_CODE' ||
row.type == 'AREABASIC_CODE' ||
row.type == 'LOCATIONGROUP_CODE' ||
row.type == 'LOCATION_CODE'
"
>
<el-option
v-for="item in row.initOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-input
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
v-else
/>
</el-form-item>
</el-form>
</template>
</el-table-column>
</el-table>
<div class="button flex">
<div class="p-12px" @click="handleAddTable">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer" />
<div>添加明细</div>
</div>
</div>
</div>
</template>
<script setup>
defineComponent({
name: 'TableFormCountPlan'
})
const props = defineProps({
//
tableFields: {
type: Array,
default: () => {
return []
}
},
//
tableData: {
type: Array,
default: () => {
return []
}
},
tableFormRules: {
type: Array,
required: true,
default: null
},
countScopeType: {
type: Array,
required: false,
default: null
},
})
const tableData = props.tableData
const tableFields = props.tableFields
const TableBaseComponents_Ref = ref()
const TableBaseForm_Ref = ref()
const TableBaseForm_Ref1 = ref()
const tableFormRules = ref(props.tableFormRules)
console.log('tableFormRules',tableFormRules.value)
/**
* 验证表单是否符合rules
* @param {*} success 如果验证成功走的方法
* @param {*} error 如果验证不成功走的方法
*/
const validateForm = () => {
let TableBaseForm_Arr = []
TableBaseForm_Arr.push(TableBaseForm_Ref.value)
TableBaseForm_Arr.push(TableBaseForm_Ref1.value)
let _lists = TableBaseForm_Arr?.map(v => v.validate())
return Promise.all(_lists).then(() => {
return true
}).catch(() => {
return false
})
}
//
const emit = defineEmits(['handleAddTable', 'selectChange', 'tableFormChange'])
//
const selectChange = (field, val) => {
emit('selectChange', field, val)
}
const tableFormChange = (field, val, row) => {
emit('tableFormChange', field, val, row)
}
//
const handleAddTable = () => {
emit('handleAddTable')
}
// setup
defineExpose({
TableBaseComponents_Ref,
validateForm
})
</script>
<style scoped lang="scss">
.button {
> div {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
> div {
margin-left: 6px;
text-decoration: underline;
color: #409eff;
}
}
}
</style>

18
src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts

@ -648,7 +648,6 @@ export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
width: 300 width: 300
}, },
tableForm: { tableForm: {
type: 'InputString',
width: '300', width: '300',
} }
}, },
@ -665,19 +664,10 @@ export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
} }
])) ]))
export const CountPlanDetailRules = reactive({ export const CountPlanDetailRules = reactive({
available: [ type: [
{ required: true, message: '请选择是否可用', trigger: 'change' } { required: true, message: '请选择盘点范围类型', trigger: 'change' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
planQty: [
{ required: true, message: '请输入计划数量', trigger: 'blur' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
], ],
itemCode: [ value: [
{ required: true, message: '请选择物品代码', trigger: 'change' } { required: true, message: '请选择盘点范围值', trigger: 'change' }
], ],
}) })

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

@ -57,6 +57,7 @@
:apiUpdate="CountPlanMainApi.updateCountPlanMain" :apiUpdate="CountPlanMainApi.updateCountPlanMain"
:apiCreate="CountPlanMainApi.createCountPlanMain" :apiCreate="CountPlanMainApi.createCountPlanMain"
fromeWhere="countPlan" fromeWhere="countPlan"
:countScopeType="getStrDictOptions(DICT_TYPE.COUNT_SCOPE_TYPE)"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@ -64,6 +65,7 @@
@formSelectChange="formSelectChange" @formSelectChange="formSelectChange"
@formSelectvVisibleChange="formSelectvVisibleChange" @formSelectvVisibleChange="formSelectvVisibleChange"
@selectChange="selectChange" @selectChange="selectChange"
@tableFormChange="tableFormChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -79,6 +81,7 @@
:apiPage="CountPlanDetailApi.getCountPlanDetailPage" :apiPage="CountPlanDetailApi.getCountPlanDetailPage"
:apiDelete="CountPlanDetailApi.deleteCountPlanDetail" :apiDelete="CountPlanDetailApi.deleteCountPlanDetail"
:Echo="Echo" :Echo="Echo"
fromeWhere="countPlan"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -112,6 +115,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
console.log('CountPlanDetail.allSchemas', CountPlanDetail.allSchemas)
// //
defineOptions({ name: 'CountPlanMain' }) defineOptions({ name: 'CountPlanMain' })
@ -290,7 +294,10 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type: string, row?: number) => { const openForm = async (type: string, row?: number) => {
tableData.value = [] // tableData.value = [ {
type: '',
value: ''
}] //
formRef.value.open(type, row) formRef.value.open(type, row)
getOwnerAllList() getOwnerAllList()
@ -341,16 +348,22 @@ const handleExport = async () => {
/** /**
* tableForm方法 * tableForm方法
*/ */
const tableFormKeys = {} let tableFormKeys = {}
CountPlanDetail.allSchemas.tableFormColumns.forEach((item) => { CountPlanDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
const tableData = ref([]) const tableData = ref([{
type: '',
value: ''
}])
// //
const handleAddTable = () => { const handleAddTable = () => {
console.log(tableFormKeys) // tableFormKeys.formType=''
tableFormKeys.formType = 'Select' tableFormKeys = {
type: '',
value: ''
}
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
} }
// //
@ -360,7 +373,13 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value.map(item=>{
return{
type:item.type,
value:item.value,
}
}) //
console.log(tableData.value)
try { try {
if (formType === 'create') { if (formType === 'create') {
await CountPlanMainApi.createCountPlanMain(data) await CountPlanMainApi.createCountPlanMain(data)
@ -404,7 +423,6 @@ const searchFormClick = (searchData) => {
} }
// //
const selectChange = (field, val) => { const selectChange = (field, val) => {
console.log(val)
if (field == 'type') { if (field == 'type') {
if (val == 'DYNAMIC') { if (val == 'DYNAMIC') {
CountPlanMain.allSchemas.formSchema[3].label = '限值(%)' CountPlanMain.allSchemas.formSchema[3].label = '限值(%)'
@ -421,74 +439,71 @@ const selectChange = (field, val) => {
} }
} }
} }
let valueList = []
// //
const formSelectChange = async (field, val, row) => { const tableFormChange = async (field, val, row) => {
console.log(row[field])
console.log(field) console.log(field)
console.log(val) console.log(val)
if (field == 'type') { if (field == 'type') {
row.value = '' row.value = ''
if (row.type == 'OWNER' || row.type == 'SUPPLIER'|| row.type == 'CUSTOMER'|| row.type == 'ABC'|| row.type == 'ITEMS_TYPE'|| row.type == 'ITEMS_GROUP'||row.type == 'ITEMS_CODE'||row.type == 'WAREHOUSE_CODE'||row.type == 'AREABASIC_CODE'||row.type == 'LOCATIONGROUP_CODE'||row.type == 'LOCATION_CODE') { if (
row.type == 'OWNER' ||
row.type == 'SUPPLIER' ||
row.type == 'CUSTOMER' ||
row.type == 'ABC' ||
row.type == 'ITEMS_TYPE' ||
row.type == 'ITEMS_GROUP' ||
row.type == 'ITEMS_CODE' ||
row.type == 'WAREHOUSE_CODE' ||
row.type == 'AREABASIC_CODE' ||
row.type == 'LOCATIONGROUP_CODE' ||
row.type == 'LOCATION_CODE'
) {
row.formType = 'Select'
switch (row.type) {
case 'OWNER':
row.initOptions = ownerAllList.value
break
case 'SUPPLIER':
row.initOptions = supplierAllList.value
break
case 'CUSTOMER':
row.initOptions = customerAllList.value
break
case 'ABC':
row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS)
break
case 'ITEMS_TYPE':
row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_TYPE)
break
case 'ITEMS_GROUP':
row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break
case 'ITEMS_CODE':
row.initOptions = itembasicAllList.value
break
case 'WAREHOUSE_CODE':
row.initOptions = warehouseAllList.value
break
case 'AREABASIC_CODE':
row.initOptions = areaAllList.value
break
case 'LOCATIONGROUP_CODE':
row.initOptions = locationgroupAllList.value
break
case 'LOCATION_CODE':
row.initOptions = locationAllList.value
break
}
} else if (row.type == 'PROJECT') {
row.formType = 'InputString' row.formType = 'InputString'
// row.initOptions = valueList
}else if(row.type == 'PROJECT'){
// row = {
// type: 'InputString',
// width: '300',
// initOptions: valueList
// }
} }
} }
} }
const formSelectvVisibleChange = async (field, val, row) => {
console.log(getStrDictOptions(DICT_TYPE.ABC_CLASS))
switch (row.type) {
case 'OWNER':
valueList = ownerAllList.value
break;
case 'SUPPLIER':
valueList = supplierAllList.value
break;
case 'CUSTOMER':
valueList = customerAllList.value
break;
case 'ABC':
valueList = getStrDictOptions(DICT_TYPE.ABC_CLASS)
break;
case 'ITEMS_TYPE':
valueList = getStrDictOptions(DICT_TYPE.ITEM_TYPE)
break;
case 'ITEMS_GROUP':
valueList = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break;
case 'ITEMS_CODE':
valueList = itembasicAllList.value
break;
case 'WAREHOUSE_CODE':
valueList = warehouseAllList.value
break
case 'AREABASIC_CODE':
valueList = areaAllList.value
break
case 'LOCATIONGROUP_CODE':
valueList = locationgroupAllList.value
break
case 'LOCATION_CODE':
valueList = locationAllList.value
break
}
CountPlanDetail.allSchemas.tableFormColumns[1].tableForm = {
type: 'Select',
width: '300',
initOptions: valueList
}
}
const ownerAllList = ref() const ownerAllList = ref()
const supplierAllList = ref() const supplierAllList = ref()
const customerAllList = ref() const customerAllList = ref()
const itembasicAllList = ref() const itembasicAllList = ref()
const warehouseAllList = ref() const warehouseAllList = ref()
const areaAllList = ref() const areaAllList = ref()
const locationgroupAllList = ref() const locationgroupAllList = ref()
@ -535,7 +550,7 @@ const getItembasicAllList = async () => {
} }
// //
const getWarehouseAllList = async () => { const getWarehouseAllList = async () => {
await WarehouseApi.getWarehouseList({available:'TRUE'}).then((res) => { await WarehouseApi.getWarehouseList({ available: 'TRUE' }).then((res) => {
res.forEach((element) => { res.forEach((element) => {
element.value = element.code element.value = element.code
element.label = element.name element.label = element.name
@ -545,7 +560,7 @@ const getWarehouseAllList = async () => {
} }
// //
const getAreaAllList = async () => { const getAreaAllList = async () => {
await AreaApi.getAreaList({available:'TRUE'}).then((res) => { await AreaApi.getAreaList({ available: 'TRUE' }).then((res) => {
res.forEach((element) => { res.forEach((element) => {
element.value = element.code element.value = element.code
element.label = element.name element.label = element.name
@ -555,7 +570,7 @@ const getAreaAllList = async () => {
} }
// //
const getLocationgroupAllList = async () => { const getLocationgroupAllList = async () => {
await LocationgroupApi.getLocationgroupList({available:'TRUE'}).then((res) => { await LocationgroupApi.getLocationgroupList({ available: 'TRUE' }).then((res) => {
res.forEach((element) => { res.forEach((element) => {
element.value = element.code element.value = element.code
element.label = element.name element.label = element.name
@ -565,7 +580,7 @@ const getLocationgroupAllList = async () => {
} }
// //
const getLocationAllList = async () => { const getLocationAllList = async () => {
await LocationpApi.getLocationList({available:'TRUE'}).then((res) => { await LocationpApi.getLocationList({ available: 'TRUE' }).then((res) => {
res.forEach((element) => { res.forEach((element) => {
element.value = element.code element.value = element.code
element.label = element.name element.label = element.name

41
src/views/wms/inventoryjobManage/transferissue/transferissueJobMain/index.vue

@ -71,6 +71,8 @@ import { TransferissueJobMain,TransferissueJobMainRules,TransferissueJobDetail,T
import * as TransferissueJobMainApi from '@/api/wms/transferissueJobMain' import * as TransferissueJobMainApi from '@/api/wms/transferissueJobMain'
import * as TransferissueJobDetailApi from '@/api/wms/transferissueJobDetail' import * as TransferissueJobDetailApi from '@/api/wms/transferissueJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchasereceiptJobMainApi from "@/api/wms/purchasereceiptJobMain";
import {acceptTransferissueJobMain} from "@/api/wms/transferissueJobMain";
// //
defineOptions({ name: 'TransferissueJobMain' }) defineOptions({ name: 'TransferissueJobMain' })
@ -174,9 +176,9 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // // defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1'])}), // // defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:transferissue-job-main:close'}), //
defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // //defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // // defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), //
] ]
} }
@ -187,13 +189,46 @@ const buttonTableClick = async (val, row) => {
console.log('列表-操作按钮事件-执行') console.log('列表-操作按钮事件-执行')
} else if (val == 'mainJobAba') { // } else if (val == 'mainJobAba') { //
console.log('列表-操作按钮事件-放弃') console.log('列表-操作按钮事件-放弃')
handleAbandon(row.id)
} else if (val == 'mainJobClo') { // } else if (val == 'mainJobClo') { //
console.log('列表-操作按钮事件-关闭') console.log('列表-操作按钮事件-关闭')
handleClose(row.id)
} else if (val == 'mainJobAcc') { // } else if (val == 'mainJobAcc') { //
console.log('列表-操作按钮事件-承接') console.log('列表-操作按钮事件-承接')
handleAccept(row.id)
} }
} }
/** 放弃按钮操作 */
const handleAbandon = async (id: number) => {
try {
await message.confirm(t('common.confirmColse'))
await TransferissueJobMainApi.abandonTransferissueJobMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
await message.confirm(t('common.confirmColse'))
await TransferissueJobMainApi.closeTransferissueJobMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}
}
/** 承接按钮操作 */
const handleAccept = async (id: number) => {
try {
await message.confirm(t('common.confirmColse'))
await TransferissueJobMainApi.acceptTransferissueJobMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}
}
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {

118
src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue

@ -82,6 +82,9 @@ import { TransferissueRequestMain,TransferissueRequestMainRules,TransferissueReq
import * as TransferissueRequestMainApi from '@/api/wms/transferissueRequestMain' import * as TransferissueRequestMainApi from '@/api/wms/transferissueRequestMain'
import * as TransferissueRequestDetailApi from '@/api/wms/transferissueRequestDetail' import * as TransferissueRequestDetailApi from '@/api/wms/transferissueRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchasereturnRequestMainApi from "@/api/wms/purchasereturnRequestMain";
import {closeTransferissueRequestMain} from "@/api/wms/transferissueRequestMain";
import * as PurchasereceiptRequestMainApi from "@/api/wms/purchasereceiptRequestMain";
// //
defineOptions({ name: 'TransferissueRequestMain' }) defineOptions({ name: 'TransferissueRequestMain' })
@ -104,13 +107,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] if (formField == 'packingNumber') {
row['packingNumber'] = val[0]['packingNumber'] row['packingNumber'] = val[0]['packingNumber']
row['containerNumber'] = val[0]['containerNumber'] row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch'] row['batch'] = val[0]['batch']
row['inventoryStatus'] = val[0]['inventoryStatus'] row['inventoryStatus'] = val[0]['inventoryStatus']
row['toLocationCode'] = val[0]['locationCode'] row['fromLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
} else {
row[formField] = val[0][searchField]
}
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -122,13 +128,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] if(formField == 'packingNumber'){
setV['packingNumber'] = val[0]['packingNumber'] setV['packingNumber'] = val[0]['packingNumber']
setV['containerNumber'] = val[0]['containerNumber'] setV['containerNumber'] = val[0]['containerNumber']
setV['batch'] = val[0]['batch'] setV['batch'] = val[0]['batch']
setV['inventoryStatus'] = val[0]['inventoryStatus'] setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['toLocationCode'] = val[0]['locationCode'] setV['fromLocationCode'] = val[0]['locationCode']
setV['itemCode'] = val[0]['itemCode'] setV['itemCode'] = val[0]['itemCode']
}else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
@ -190,13 +199,13 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:transferissue-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:transferissue-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:transferissue-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:transferissue-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:transferissue-request-main:agree'}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:transferissue-request-main:update'}), // defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:transferissue-request-main:handle'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:transferissue-request-main:delete'}), // defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:transferissue-request-main:update'}), //
] ]
} }
@ -206,14 +215,21 @@ const butttondata = (row) => {
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { // if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭') console.log('列表-操作按钮事件-关闭')
handleClose(row.id)
} else if (val == 'mainReAdd') { // } else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加') console.log('列表-操作按钮事件-重新添加')
handleReAdd(row.id)
} else if (val == 'mainSubmit') { // } else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批') console.log('列表-操作按钮事件-提交审批')
handleSubmit(row.id)
} else if (val == 'mainTurnDown') { // } else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回') console.log('列表-操作按钮事件-驳回')
handleRefused(row.id)
} else if (val == 'mainApprove') { // } else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过') console.log('列表-操作按钮事件-审批通过')
handleAgree(row.id)
} else if (val == 'mainHandle') { //
handleHandle(row.id)
} else if (val == 'edit') { // } else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
@ -221,6 +237,66 @@ const buttonTableClick = async (val, row) => {
} }
} }
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
await message.confirm(t('common.confirmColse'))
await TransferissueRequestMainApi.closeTransferissueRequestMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}
}
/** 重新添加按钮操作 */
const handleReAdd = async (id: number) => {
try {
await message.confirm(t('common.confirmReAdd'))
await TransferissueRequestMainApi.reAddTransferissueRequestMain(id)
message.success(t('common.reAddSuccess'))
await getList()
} catch {}
}
/** 提交按钮操作 */
const handleSubmit = async (id: number) => {
try {
await message.confirm(t('common.confirmSubmit'))
await TransferissueRequestMainApi.submitTransferissueRequestMain(id)
message.success(t('common.submitSuccess'))
await getList()
} catch {}
}
/** 审批驳回按钮操作 */
const handleRefused = async (id: number) => {
try {
await message.confirm(t('common.confirmRefused'))
await TransferissueRequestMainApi.refusedTransferissueRequestMain(id)
message.success(t('common.refusedSuccess'))
await getList()
} catch {}
}
/** 审批通过按钮操作 */
const handleAgree = async (id: number) => {
try {
await message.confirm(t('common.confirmAgree'))
await TransferissueRequestMainApi.agreeTransferissueRequestMain(id)
message.success(t('common.agreeSuccess'))
await getList()
} catch {}
}
/** 处理按钮操作 */
const handleHandle = async (id: number) => {
try {
await message.confirm(t('common.confirmHandle'))
await TransferissueRequestMainApi.handleTransferissueRequestMain(id)
message.success(t('common.handleSuccess'))
await getList()
} catch {}
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: number) => {

115
src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts

@ -11,6 +11,9 @@ import { Dock } from '@/views/wms/basicDataManage/factoryModeling/dock/dock.data
import * as BalanceApi from '@/api/wms/balance' import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -24,6 +27,9 @@ const queryParams = {
// 获取当前操作人的部门 // 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WarehouseApi from "@/api/wms/warehouse";
const userStore = useUserStore() const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept const userDept = userStore.userSelfInfo.dept
@ -88,10 +94,11 @@ export const TransferissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '运输方式', label: '运输方式',
field: 'transferMode', field: 'transferMode',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRANSFER_MODE,
dictClass: 'string',
table: { table: {
width: 150 width: 150
}, },
isSearch: true,
}, },
{ {
label: '车牌号', label: '车牌号',
@ -151,7 +158,30 @@ export const TransferissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
isForm: false, tableForm: {
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码',
searchField: 'code',
searchTitle: '仓库信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库信息', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}, },
{ {
label: '到仓库代码', label: '到仓库代码',
@ -160,7 +190,30 @@ export const TransferissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
isForm: false, tableForm: {
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码',
searchField: 'code',
searchTitle: '仓库信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库信息', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}, },
{ {
label: '从库位类型范围', label: '从库位类型范围',
@ -189,7 +242,7 @@ export const TransferissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '从库区代码范围', label: '从库区代码范围',
field: 'fromAreaCode', field: 'fromAreaCodes',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -544,7 +597,12 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
searchField: 'packingNumber', searchField: 'packingNumber',
searchTitle: '库存余额信息', searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas, searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage searchPage: BalanceApi.getBalancePage,
searchCondition: [{
key: 'warehouseCode',
value: 'fromWarehouseCode',
isMainValue: true,
}]
}, },
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
@ -554,7 +612,12 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
searchField: 'packingNumber', searchField: 'packingNumber',
searchTitle: '库存余额信息', searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas, searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage searchPage: BalanceApi.getBalancePage,
searchCondition: [{
key: 'warehouseCode',
value: 'fromWarehouseCode',
isMainValue: true,
}]
} }
} }
}, },
@ -603,6 +666,17 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
type: 'Select' type: 'Select'
} }
}, },
{
label: '来源库位',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
}
},
{ {
label: '到库位代码', label: '到库位代码',
field: 'toLocationCode', field: 'toLocationCode',
@ -611,7 +685,32 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
width: 150 width: 150
}, },
tableForm: { tableForm: {
disabled: true, isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.getLocationPage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'warehouseCode',
value: 'toWarehouseCode',
isMainValue: true,
}]
}
} }
}, },
{ {
@ -758,4 +857,4 @@ export const TransferissueRequestDetailRules = reactive({
itemCode: [ itemCode: [
{ required: true, message: '请选择物品代码', trigger: 'change' } { required: true, message: '请选择物品代码', trigger: 'change' }
], ],
}) })

151
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -70,14 +70,30 @@
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
/> />
<!-- 创建标签 -->
<BasicForm
ref="formLabelRef"
@success="getList"
:tableAllSchemas="detailListTableColumns"
:tableFormRules="ProductionreturnRequestDetailLabelRules"
:tableData="detatableData.tableList"
:isBusiness="true"
:isShowButton="false"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitFormLabel"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules } from './productionreturnRequestMain.data' import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules } from './productionreturnRequestMain.data'
import * as ProductionreturnRequestMainApi from '@/api/wms/productionreturnRequestMain' import * as ProductionreturnRequestMainApi from '@/api/wms/productionreturnRequestMain'
import * as ProductionreturnRequestDetailApi from '@/api/wms/productionreturnRequestDetail' import * as ProductionreturnRequestDetailApi from '@/api/wms/productionreturnRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic'
import * as PackageApi from '@/api/wms/package'
// 退 // 退
defineOptions({ name: 'ProductionreturnRequestMain' }) defineOptions({ name: 'ProductionreturnRequestMain' })
@ -90,6 +106,24 @@ const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns) const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
//
const dialogVisible = ref(false)
const dialogTitle = ref('创建标签')
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
//
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage
})
const { getList:getDetailList } = detatableMethods
//
const saveLabel = () => {
isCreateLabel.value = true
}
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -132,12 +166,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
if(formField == 'packingNumber') { if(formField == 'itemCode') {
setV['packingNumber'] = val[0]['packingNumber']
setV['containerNumber'] = val[0]['containerNumber']
setV['batch'] = val[0]['batch'] setV['batch'] = val[0]['batch']
setV['itemCode'] = val[0]['itemCode'] setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty') {
item.tableForm.max = val[0]['qty']
}
})
} else if(formField == 'workStationCode') {
setV['workStationCode'] = val[0]['code']
setV['fromLocationCode'] = val[0]['rawLocationCode']
} else { } else {
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
} }
@ -192,10 +235,21 @@ const butttondata = (row) => {
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:productionreturn-request-main:reAdd'}), // defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:productionreturn-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productionreturn-request-main:submit'}), // defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productionreturn-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productionreturn-request-main:refused'}), // defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productionreturn-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productionreturn-request-main:handle'}), // defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productionreturn-request-main:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:productionreturn-request-main:update'}), // defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:productionreturn-request-main:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productionreturn-request-main:update'}), // defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productionreturn-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionreturn-request-main:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:productionreturn-request-main:delete'}), //
//
{
label: '创建标签',
name: 'cjbq',
hide: isShowMainButton(row,['3']),
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
},
] ]
} }
@ -234,13 +288,79 @@ const buttonTableClick = async (val, row) => {
console.log(err) console.log(err)
}) })
} else if (val == 'mainApprove') { // } else if (val == 'mainApprove') { //
await message.confirm('确认要审批通过吗?')
ProductionreturnRequestMainApi.agree(row.id).then(() => { ProductionreturnRequestMainApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
getList() getList()
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
} else if (val == 'cjbq') { //
detatableData.params = {
masterId:row.id
}
await getDetailList()
//
if (detatableData.tableList[0].packingNumber) {
message.warning('已创建过标签!!!')
return
}
//
// dialogVisible.value = true
formLabelRef.value.open('create', row)
detatableData.tableList.map((item) => {
item.batch = '000000'
// 线
ItembasicApi.getItembasicPage({
pageSize: 10,
pageNo: 1,
code: item.itemCode,
sort: '',
by: 'ASC',
}).then(res => {
if (res.list.length > 0) {
//
if (res.list[0].type == "RAW") {
// tableform
detailListTableColumns.tableFormColumns.map(item => {
if(item.field == 'productionLineCodePackage') {
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false
}
if(item.field == 'supplierItemCode') {
item.tableForm.isInpuFocusShow = true
item.tableForm.disabled = false
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true
}
})
} else {
// tableform
detailListTableColumns.tableFormColumns.map(item => {
if(item.field == 'supplierItemCode') {
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false
}
if(item.field == 'productionLineCodePackage') {
item.tableForm.isInpuFocusShow = true
item.tableForm.disabled = false
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true
}
})
}
} else {
message.warning('没有查询到物品代码:【' + item.itemCode + '】')
return
}
})
})
} else if (val == 'mainHandle') { // } else if (val == 'mainHandle') { //
if (!isCreateLabel.value) {
message.warning('请先创建标签')
return
}
ProductionreturnRequestMainApi.handle(row.id).then(() => { ProductionreturnRequestMainApi.handle(row.id).then(() => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
getList() getList()
@ -335,6 +455,25 @@ const submitForm = async (formType, data) => {
} }
} }
//
const submitFormLabel = async (formType, data) => {
try {
detatableData.tableList.forEach(async (item) => {
await PackageApi.createPackageLabel(item).then(res => {
isCreateLabel.value = true
message.success('创建标签成功')
}).catch(err => {
isCreateLabel.value = false
console.log(err)
message.error('创建标签失败')
})
})
} finally {
formLabelRef.value.formLoading = false
formLabelRef.value.dialogVisible = false
}
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {

296
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts

@ -14,6 +14,12 @@ import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/worksta
import * as BalanceApi from '@/api/wms/balance' import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -715,23 +721,29 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
} }
}, },
{ {
label: '从库位代码', label: '单据号',
field: 'fromLocationCode', field: 'number',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: false, isTableForm: false,
isForm: false, form: {
componentProps: {
disabled: true
}
}
}, },
{ {
label: '单据号', label: '包装号',
field: 'number', field: 'packingNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: false, tableForm: {
disabled: true
},
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
@ -847,9 +859,9 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
//表单校验 //表单校验
export const ProductionreturnRequestDetailRules = reactive({ export const ProductionreturnRequestDetailRules = reactive({
packingNumber: [ // packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' } // { required: true, message: '请选择包装号', trigger: 'change' }
], // ],
batch: [ batch: [
{ required: true, message: '请输入批次', trigger: 'blur' } { required: true, message: '请输入批次', trigger: 'blur' }
], ],
@ -862,4 +874,268 @@ export const ProductionreturnRequestDetailRules = reactive({
itemCode: [ itemCode: [
{ required: true, message: '请输入物品代码', trigger: 'blur' } { required: true, message: '请输入物品代码', trigger: 'blur' }
], ],
}) })
/**
* @returns {Array} 退
*/
export const ProductionreturnRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCodePackage',
sort: 'custom',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'productionLineCode', // 查询弹窗赋值字段
searchTitle: '生产线物品关系信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'itemCode',
value: 'itemCode',
isMainValue: true
}]
}
},
{
label: '供应商代码',
field: 'supplierItemCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'supplierCode', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'itemCode',
value: 'itemCode',
isMainValue: true
}]
}
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '来源生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '来源生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '来源工位代码',
field: 'workStationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '来源库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
]))
//表单校验
export const ProductionreturnRequestDetailLabelRules = reactive({
supplierItemCode: [
{ required: true, message: '请选择供应商', trigger: 'change' }
],
productionLineCodePackage: [
{ required: true, message: '请选择生产线', trigger: 'change' }
]
})

887
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -13,16 +13,16 @@
<!-- 列表 --> <!-- 列表 -->
<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>
@ -38,8 +38,7 @@
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas" <Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas"
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas" :detailAllSchemas="SupplierdeliverRequestDetail.allSchemas" :detailAllSchemasRules="SupplierdeliverRequestDetailRules"
:detailAllSchemasRules="SupplierdeliverRequestDetailRules"
:apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail" :apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail"
:apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail" :apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail"
:apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage" :apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage"
@ -47,18 +46,16 @@
@searchTableSuccessDetail="searchTableSuccessDetail" /> @searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import" <ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import" :importTemplateData="importTemplateData"
:importTemplateData="importTemplateData" @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
:mode="2" />
<!-- 打印 --> <!-- 打印 -->
<el-dialog v-model="dialogVisible " :title="dialogTitle" width="60%"> <el-dialog v-model="dialogVisible" :title="dialogTitle" width="60%">
<Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading" <Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading" :pagination="{
:pagination="{ total: detatableData.total
total: detatableData.total }" v-model:pageSize="detatableData.pageSize" v-model:currentPage="detatableData.currentPage"
}" v-model:pageSize="detatableData.pageSize" v-model:currentPage="detatableData.currentPage"
v-model:sort="detatableData.sort"> v-model:sort="detatableData.sort">
<template #batch="{row}"> <template #batch="{ row }">
<el-input v-model="row.batch">{{ row.batch }}</el-input> <el-input v-model="row.batch">{{ row.batch }}</el-input>
</template> </template>
</Table> </Table>
@ -70,449 +67,449 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { SupplierdeliverRequestMain, SupplierdeliverRequestMainRules, SupplierdeliverRequestDetail, SupplierdeliverRequestDetailRules } from './supplierdeliverRequestMain.data' import { SupplierdeliverRequestMain, SupplierdeliverRequestMainRules, SupplierdeliverRequestDetail, SupplierdeliverRequestDetailRules } from './supplierdeliverRequestMain.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import * as PackageApi from '@/api/wms/package' // import * as PackageApi from '@/api/wms/package'
// import * as BarbasicApi from '@/api/wms/barbasic' // import * as BarbasicApi from '@/api/wms/barbasic'
// //
defineOptions({ name: 'SupplierdeliverRequestMain' }) defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns) const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns)
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
} else { } else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierdeliver-request-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:supplierdeliver-request-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
}
}
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4']) }), //
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierdeliver-request-main:update' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:supplierdeliver-request-main:delete' }), //
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListDocumentPrintBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') { //
handleOpe(row.id)
} else if (val == 'mainPurPlanClo') {//
handleClo(row.id)
} else if (val == 'mainPlanSub') { //
handleSub(row.id)
} else if (val == 'mainPlanApp') { //
handleApp(row.id)
} else if (val == 'mainPlanTur') { //
handleTur(row.id)
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row)
} else if (val == 'documentPrint') { //
handleDocumentPrint(row.id)
} }
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
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: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierdeliver-request-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:supplierdeliver-request-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} }
}
/** 添加/修改操作 */
const formRef = ref() //
const openForm = async (type : string, row ?: number) => { const isShowMainButton = (row, val) => {
tableData.value = [] // if (val.indexOf(row.status) > -1) {
formRef.value.open(type, row) return false
} } else {
return true
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await SupplierdeliverRequestMainApi.deleteSupplierdeliverRequestMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 关闭按钮操作 */
const handleClo = async (id : number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
//
await SupplierdeliverRequestMainApi.cloSupplierdeliverRequestMain(id)
message.success(t('关闭成功!'))
//
await getList()
} catch { }
}
/** 打开按钮操作 */
const handleOpe = async (id : number) => {
try {
//
await message.confirm('是否打开所选中数据?')
//
await SupplierdeliverRequestMainApi.opeSupplierdeliverRequestMain(id)
message.success(t('打开成功!'))
//
await getList()
} catch { }
}
/** 提交审批按钮操作 */
const handleSub = async (id : number) => {
try {
//
await message.confirm('是否提交审批所选中数据?')
//
await SupplierdeliverRequestMainApi.subSupplierdeliverRequestMain(id)
message.success(t('提交审批成功!'))
//
await getList()
} catch { }
}
/** 审批通过按钮操作 */
const handleApp = async (id : number) => {
try {
//
await message.confirm('是否审批通过所选中数据?')
//
await SupplierdeliverRequestMainApi.appSupplierdeliverRequestMain(id)
message.success(t('审批通过成功!'))
//
await getList()
} catch { }
} }
}
/** 驳回按钮操作 */
const handleTur = async (id : number) => { // -
try { const butttondata = (row) => {
// return [
await message.confirm('是否驳回所选中数据?') defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
// defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4']) }), //
await SupplierdeliverRequestMainApi.rejSupplierdeliverRequestMain(id) defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
message.success(t('驳回成功!')) defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), //
// defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), //
await getList() defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierdeliver-request-main:update' }), //
} catch { } defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:supplierdeliver-request-main:delete' }), //
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListDocumentPrintBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') { //
handleOpe(row.id)
} else if (val == 'mainPurPlanClo') {//
handleClo(row.id)
} else if (val == 'mainPlanSub') { //
handleSub(row.id)
} else if (val == 'mainPlanApp') { //
handleApp(row.id)
} else if (val == 'mainPlanTur') { //
handleTur(row.id)
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row)
} else if (val == 'documentPrint') { //
handleDocumentPrint(row.id)
} }
}
/** 导出按钮操作 */
const exportLoading = ref(false) // /** 添加/修改操作 */
const handleExport = async () => { const formRef = ref()
try { const openForm = async (type: string, row?: number) => {
// tableData.value = [] //
await message.exportConfirm() formRef.value.open(type, row)
// }
exportLoading.value = true
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(setSearchParams) /** 详情操作 */
download.excel(data, '供应商发货申请主.xls') const detailRef = ref()
} catch { const openDetail = (row: any, titleName: any, titleValue: any) => {
} finally { detailRef.value.openDetail(row, titleName, titleValue)
exportLoading.value = false }
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SupplierdeliverRequestMainApi.deleteSupplierdeliverRequestMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 关闭按钮操作 */
const handleClo = async (id: number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
//
await SupplierdeliverRequestMainApi.cloSupplierdeliverRequestMain(id)
message.success(t('关闭成功!'))
//
await getList()
} catch { }
}
/** 打开按钮操作 */
const handleOpe = async (id: number) => {
try {
//
await message.confirm('是否打开所选中数据?')
//
await SupplierdeliverRequestMainApi.opeSupplierdeliverRequestMain(id)
message.success(t('打开成功!'))
//
await getList()
} catch { }
}
/** 提交审批按钮操作 */
const handleSub = async (id: number) => {
try {
//
await message.confirm('是否提交审批所选中数据?')
//
await SupplierdeliverRequestMainApi.subSupplierdeliverRequestMain(id)
message.success(t('提交审批成功!'))
//
await getList()
} catch { }
}
/** 审批通过按钮操作 */
const handleApp = async (id: number) => {
try {
//
await message.confirm('是否审批通过所选中数据?')
//
await SupplierdeliverRequestMainApi.appSupplierdeliverRequestMain(id)
message.success(t('审批通过成功!'))
//
await getList()
} catch { }
}
/** 驳回按钮操作 */
const handleTur = async (id: number) => {
try {
//
await message.confirm('是否驳回所选中数据?')
//
await SupplierdeliverRequestMainApi.rejSupplierdeliverRequestMain(id)
message.success(t('驳回成功!'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(setSearchParams)
download.excel(data, '供应商发货申请主.xls')
} catch {
} finally {
exportLoading.value = false
} }
}
//
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({ //
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({
}) getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage
})
const { getList: getDetailList } = detatableMethods
const { getList: getDetailList } = detatableMethods
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns)
const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作' && item.label != '创建者' && item.label != '创建时间' && item.label != '最后更新者' && item.label != '最后更新时间') const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns)
const dialogVisible = ref(false) const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作' && item.label != '创建者' && item.label != '创建时间' && item.label != '最后更新者' && item.label != '最后更新时间')
const isShow = ref(false) const dialogVisible = ref(false)
const dialogTitle = ref('') const isShow = ref(false)
const closeDialog = () => { const dialogTitle = ref('')
const closeDialog = () => {
dialogVisible.value = false
isShow.value = false
}
/** 生成标签按钮操作 */
const genLabel = async () => {
try {
//
await message.confirm('是否为此数据生成标签?')
//
await SupplierdeliverRequestMainApi.genLabel(genLabelId.value)
dialogVisible.value = false dialogVisible.value = false
isShow.value = false isShow.value = false
message.success(t('生成标签成功!'))
//
await getList()
} catch { }
}
const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
const genLabelId = ref();
//
const handlePoint = async (row) => {
tableObject.params = {
masterId: row.id,
} }
await getDetailList()
/** 生成标签按钮操作 */ dialogVisible.value = true
const genLabel = async () => { dialogTitle.value = row.number + '单据号'
try { genLabelId.value = row.number
// }
await message.confirm('是否为此数据生成标签?')
// const print = async () => {
await SupplierdeliverRequestMainApi.genLabel(genLabelId.value) //
dialogVisible.value = false // const packageArray:any= ref([])
isShow.value = false // let packageObject = {
message.success(t('生成标签成功!')) // itemCode: '',
// // itemName: '',
await getList() // itemDesc1: '',
} catch { } // itemDesc2: '',
} // batch: '',
// altBatch: '',
const BASE_URL = 'http://dev.ccwin-in.com:25110' // produceDate: '',
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken()) // validityDays: '',
const genLabelId=ref(); // expireDate: '',
// // uom: '',
const handlePoint = async (row) => { // qty: '',
tableObject.params = { // altUom: '',
masterId: row.id, // altQty: '',
} // convertRate: '',
await getDetailList() // stdPackQty: '',
dialogVisible.value = true // stdPackUnit: '',
dialogTitle.value = row.number + '单据号' // toWarehouseCode: '',
genLabelId.value = row.number // toDockCode: '',
} // toLocationCode: '',
// supplierCode: '',
const print = async () => { // supplierItemCode: '',
// // poNumber: '',
// const packageArray:any= ref([]) // poLine: '',
// let packageObject = { // rpNumber: '',
// itemCode: '', // asnNumber: '',
// itemName: '', // }
// itemDesc1: '', // //
// itemDesc2: '', // await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({
// batch: '', // number: detatableData.tableList[0].number
// altBatch: '', // }).then(res => {
// produceDate: '', // detatableData.tableList.forEach(item => {
// validityDays: '', // packageObject.itemCode=item.itemCode
// expireDate: '', // packageObject.itemName=item.itemName
// uom: '', // packageObject.itemDesc1=item.itemDesc1
// qty: '', // packageObject.itemDesc2=item.itemDesc2
// altUom: '', // packageObject.batch=item.batch
// altQty: '', // packageObject.altBatch=item.altBatch
// convertRate: '', // packageObject.produceDate=item.produceDate
// stdPackQty: '', // packageObject.expireDate=item.expireDate
// stdPackUnit: '', // packageObject.uom=item.uom
// toWarehouseCode: '', // packageObject.qty=item.qty
// toDockCode: '', // packageObject.stdPackQty=item.stdPackQty
// toLocationCode: '', // packageObject.stdPackUnit=item.stdPackUnit
// supplierCode: '', // packageObject.convertRate=item.convertRate
// supplierItemCode: '', // packageObject.poNumber=item.poNumber
// poNumber: '', // packageObject.poLine=item.poLine
// poLine: '', // packageObject.supplierCode=res.list[0].supplierCode
// rpNumber: '', // packageObject.rpNumber=res.list[0].ppNumber
// asnNumber: '', // packageArray.value.push(packageObject)
// } // })
// // // })
// await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({ // const barBasicArray:any =ref([])
// number: detatableData.tableList[0].number // let barBasicObject = {
// }).then(res => { // type: '',
// detatableData.tableList.forEach(item => { // template: '',
// packageObject.itemCode=item.itemCode // status: '',
// packageObject.itemName=item.itemName // relateNumber: '',
// packageObject.itemDesc1=item.itemDesc1 // barcodeString: '',
// packageObject.itemDesc2=item.itemDesc2 // printTimes: '',
// packageObject.batch=item.batch // lastPrintTime: '',
// packageObject.altBatch=item.altBatch // lastPrintUserId: '',
// packageObject.produceDate=item.produceDate // lastPrintUserName: '',
// packageObject.expireDate=item.expireDate // }
// packageObject.uom=item.uom // //
// packageObject.qty=item.qty // await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => {
// packageObject.stdPackQty=item.stdPackQty // res.list.forEach(item => {
// packageObject.stdPackUnit=item.stdPackUnit // barBasicObject.type = 'PurchaseLabel'
// packageObject.convertRate=item.convertRate // barBasicObject.relateNumber = item.number
// packageObject.poNumber=item.poNumber // barBasicObject.status = 'NEW'
// packageObject.poLine=item.poLine // barBasicArray.value.push(barBasicObject)
// packageObject.supplierCode=res.list[0].supplierCode // })
// packageObject.rpNumber=res.list[0].ppNumber // })
// packageArray.value.push(packageObject) // await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value)))
// }) window.open(src.value + '&number=' + detatableData.tableList[0].number)
// }) }
// const barBasicArray:any =ref([])
// let barBasicObject = { //
// type: '', const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
// template: '', const handleDocumentPrint = async (id) => {
// status: '', window.open(documentSrc.value + '&id=' + id)
// relateNumber: '', }
// barcodeString: '',
// printTimes: '', /**
// lastPrintTime: '', * tableForm方法
// lastPrintUserId: '', */
// lastPrintUserName: '', const tableFormKeys = {}
// } SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
// //
// await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => { tableFormKeys[item.field] = item.default ? item.default : ''
// res.list.forEach(item => { })
// barBasicObject.type = 'PurchaseLabel' const tableData = ref([])
// barBasicObject.relateNumber = item.number
// barBasicObject.status = 'NEW' //
// barBasicArray.value.push(barBasicObject) const handleAddTable = () => {
// }) tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
// }) }
// await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value))) //
window.open(src.value + '&number=' + detatableData.tableList[0].number) const handleDeleteTable = (item, index) => {
} tableData.value.splice(index, 1)
}
//
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken()) //
const handleDocumentPrint = async (id) => { const submitForm = async (formType, data) => {
window.open(documentSrc.value + '&id=' + id) data.subList = tableData.value //
} try {
if (formType === 'create') {
/** await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data)
* tableForm方法 message.success(t('common.createSuccess'))
*/ } else {
const tableFormKeys = {} await SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain(data)
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => { message.success(t('common.updateSuccess'))
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 {
if (formType === 'create') {
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
} }
} formRef.value.dialogVisible = false
//
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
//
const importSuccess = () => {
getList() getList()
} finally {
formRef.value.formLoading = false
} }
}
//
const searchFormClick = (searchData) => { /** 导入 */
tableObject.params = { const importFormRef = ref()
isSearch: true, const handleImport = () => {
filters: searchData.filters importFormRef.value.open()
} }
getList() //
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
} }
getList() //
/** 初始化 **/ }
onMounted(async () => {
getList() /** 初始化 **/
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate() onMounted(async () => {
}) getList()
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
})
</script> </script>

Loading…
Cancel
Save