Browse Source

wms添加采购发货到收货记录

intex_zhaoxuebing^2
songguoqiang 6 days ago
parent
commit
f7b7ebc9db
  1. 1
      src/utils/dict.ts
  2. 382
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordWMS/index.vue
  3. 1431
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordWMS/supplierdeliverRecordMain.data.ts

1
src/utils/dict.ts

@ -430,4 +430,5 @@ export enum DICT_TYPE {
INVENTORY_MODE = "inventory_mode",
INVOICE_TYPE = 'invoice_type', // 开票种类
DELISHIF = "deliShif",// 班次
IS_RECEIVE = "is_receive",//是否生成
}

382
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordWMS/index.vue

@ -0,0 +1,382 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="[
...SupplierdeliverRecordMain.allSchemas.searchSchema,
...SupplierdeliverRecordDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverRecordMain.allSchemas"
:detailAllSchemas="SupplierdeliverRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row, $index }">
<ButtonBaseMore
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SupplierdeliverRecordMainRules"
:formAllSchemas="SupplierdeliverRecordMain.allSchemas"
:tableAllSchemas="SupplierdeliverRecordDetail.allSchemas"
:tableFormRules="SupplierdeliverRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isShowPackNumber="true"
:annexTable="[
{
label: '质检明细',
prop: 'uploadFile',
hasPermi: 'wms:supplierdeliver-request-main:uploadCheck',
tableName: 'SupplierdeliverInspectionDetail',
hasSubDetail: true, //
showPreview: true, //
showDownload: true,
hiddenDelete: true,
hiddenUpload: true,
align: 'left',
queryParams: [
{
queryField: 'tableId',
rowField: 'annexMasterId'
}
],
//
subDetailTableData: {
queryParams: [
{
queryField: 'masterId',
rowField: 'annexMasterId'
}
], //
getSubList: SupplierdeliverInspectionDetailApi.getSupplierdeliverInspectionDetailPage, //
tableColumns: SupplierdeliverInspectionDetail.allSchemas.tableColumns,
tableList: [], //
total: 1,
pageSize: 10,
currentPage: 1
}
}
]"
:isBasic="false"
:allSchemas="SupplierdeliverRecordMain.allSchemas"
:detailAllSchemas="SupplierdeliverRecordDetail.allSchemas"
:detailAllSchemasRules="SupplierdeliverRecordDetailRules"
:apiPage="SupplierdeliverRecordDetailApi.getSupplierdeliverRecordDetailPage"
:buttondataTable="buttondataTable"
@tableFormButton="tableFormButton"
/>
<!-- 父包装弹窗 -->
<BasicForm
ref="detailParenPackingRef"
@success="getList"
:tableAllSchemas="SupplierdeliverRecordDetailPickingNumer.allSchemas"
:tableFormRules="SupplierdeliverRecordDetailRules"
:tableData="detatableData.tableList"
:isBusiness="true"
:isShowButton="false"
:isShowReduceButton="false"
:isShowFooterButtton="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail'
import {
SupplierdeliverInspectionDetail,
SupplierdeliverInspectionDetailRules
} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data'
import {
SupplierdeliverRecordMain,
SupplierdeliverRecordMainRules,
SupplierdeliverRecordDetail,
SupplierdeliverRecordDetailRules,
SupplierdeliverRecordDetailPickingNumer
} from './supplierdeliverRecordMain.data'
import * as SupplierdeliverRecordMainApi from '@/api/wms/supplierdeliverRecordMain'
import * as SupplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getAccessToken } from '@/utils/auth'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import { SupplierdeliverRequestMainRules } from '../supplierdeliverRequestMain/supplierdeliverRequestMain.data'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'SupplierdeliverRecordWMS' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([
...SupplierdeliverRecordMain.allSchemas.tableColumns,
...SupplierdeliverRecordDetail.allSchemas.tableMainColumns
])
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRecordDetailApi.getSupplierdeliverRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-record-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 == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// -
const butttondata = (row, $index) => {
const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return []
}
return [
defaultButtons.mainListGenerateApplicationBtn({
hasPermi: 'wms:supplierdeliver-record-main:createPurchasereceiptRequest',
hide: !row.purchasereceiptRequestFlag
}), //
defaultButtons.mainListDocumentPrintBtn({}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'generateApplication') {
handlerCreatePurchasereceiptRequest(row.number)
} else if (val == 'documentPrint') {
//
handleDocumentPrint(row.masterId)
}
}
/** 生成采购收货申请按钮操作 */
const handlerCreatePurchasereceiptRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成采购申请吗?'))
tableObject.loading = true
await SupplierdeliverRecordMainApi.createPurchasereceiptRequest(number)
message.success(t('ts.采购申请生成成功'))
await getList()
} catch {
} finally {
tableObject.loading = false
}
}
//
const BASE_URL = getJmreportBaseUrl()
//
const documentSrc = ref(BASE_URL + '/jmreport/view/1019060741381099520?token=' + getAccessToken())
//
const documentSrc2 = ref(BASE_URL + '/jmreport/view/1019406772438372352?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
await SupplierdeliverRecordMainApi.getPoLineType(id).then(async (res) => {
if (res.isM && res.haveNOM == false) {
//
window.open(documentSrc2.value + '&id=' + id + '&type=' + 'M')
}
if (res.isM && res.haveNOM && res.noMAndItemStatus == '生准订单') {
//
window.open(documentSrc2.value + '&id=' + id )
}
if (res.isM && res.haveNOM && res.noMAndItemStatus != '生准订单') {
// M
window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M')
//
window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM')
}
if (res.isM == false) {
await SupplierdeliverRecordMainApi.getItemStatus(id).then(async (res) => {
if (res) {
//
window.open(documentSrc2.value + '&id=' + id)
} else {
window.open(documentSrc.value + '&id=' + id)
}
})
}
})
}
//
const detailParenPackingRef = ref()
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({
getListApi: SupplierdeliverRecordDetailApi.queryChildPickingNumber
})
const { getList: getDetailList } = detatableMethods
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
//masterId
const { tableObject: requestTableObject, tableMethods: requestTableMethods } = useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage //
})
const { getList: requestGetList } = requestTableMethods
requestTableObject.params.number = row.requestNumber
await requestGetList()
if (requestTableObject.tableList.length > 0) {
row.annexMasterId = requestTableObject.tableList[0].masterId
detailRef.value.openDetail(row, titleName, titleValue, 'recordSupplierdeliverMain')
}
}
// table
const buttondataTable = ref([
{
label: t('ts.查看其他包装规格'),
name: 'viewParentPickingNumber',
hide: false,
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true //
}
])
//
const tableFormButton = async (val, row) => {
if (val == 'viewParentPickingNumber') {
//
detatableData.params = {
masterId: row.masterId,
parentPackingNumber: row.packingNumber
}
await getDetailList()
detailParenPackingRef.value.open('create', row, null, 'viewDetail') //
}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await SupplierdeliverRecordMainApi.exportSupplierdeliverRecordMain(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
onActivated(() => {
getList()
})
</script>

1431
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordWMS/supplierdeliverRecordMain.data.ts

File diff suppressed because it is too large
Loading…
Cancel
Save