Browse Source

供应商发货申请操作缺少上传质量报告按钮 YT-334

intex_online20241111
叶佳兴 4 months ago
parent
commit
385d27af7b
  1. 107
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/index.vue
  2. 37
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMTypeMain/index.vue
  3. 199
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue
  4. 155
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordRefuseMain/index.vue
  5. 21
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

107
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/index.vue

@ -1,7 +1,14 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...PurchasereceiptJobMain.allSchemas.searchSchema,...PurchasereceiptJobDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="[
...PurchasereceiptJobMain.allSchemas.searchSchema,
...PurchasereceiptJobDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -17,7 +24,8 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -34,7 +42,10 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row, $index }"> <template #action="{ row, $index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -94,14 +105,17 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { PurchasereceiptJobMain, import {
PurchasereceiptJobMain,
PurchasereceiptJobMainRules, PurchasereceiptJobMainRules,
PurchasereceiptJobDetail, PurchasereceiptJobDetail,
PurchasereceiptJobDetailRules, PurchasereceiptJobDetailRules,
PurchasereceiptJobDetailPackingNumber } from './purchasereceiptJobMain.data' PurchasereceiptJobDetailPackingNumber
} from './purchasereceiptJobMain.data'
import * as PurchasereceiptJobMainApi from '@/api/wms/purchasereceiptJobMain' import * as PurchasereceiptJobMainApi from '@/api/wms/purchasereceiptJobMain'
import * as PurchasereceiptJobDetailApi from '@/api/wms/purchasereceiptJobDetail' import * as PurchasereceiptJobDetailApi from '@/api/wms/purchasereceiptJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getSwitchByCode } from '@/api/wms/switch'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getReportUrl } from '@/utils/systemParam' import { getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
@ -116,14 +130,17 @@ 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([...PurchasereceiptJobMain.allSchemas.tableColumns,...PurchasereceiptJobDetail.allSchemas.tableMainColumns]) const tableColumns = ref([
...PurchasereceiptJobMain.allSchemas.tableColumns,
...PurchasereceiptJobDetail.allSchemas.tableMainColumns
])
if (routeName.value.includes('SCP')) { if (routeName.value.includes('SCP')) {
tableColumns.value = tableColumns.value.filter(item=>item.label!='操作') tableColumns.value = tableColumns.value.filter((item) => item.label != '操作')
} }
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
if (routeName.value.includes('SCP')) { if (routeName.value.includes('SCP')) {
val = val.filter(item=>item.label!='操作') val = val.filter((item) => item.label != '操作')
} }
tableColumns.value = val tableColumns.value = val
} }
@ -168,7 +185,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const Echo = [] const Echo = []
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: routeName.value.includes('SCP')?PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPageSCP:PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPage // getListApi: routeName.value.includes('SCP')
? PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPageSCP
: PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPage //
}) })
// //
@ -179,14 +198,16 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-job-main:export' }), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-job-main:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'export') { // if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) { if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({ searchFormClick({
filters: tableObject.params.filters filters: tableObject.params.filters
@ -194,8 +215,10 @@ const buttonBaseClick = (val, item) => {
} else { } else {
getList() getList()
} }
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
@ -209,24 +232,34 @@ const isShowMainButton = (row,val) => {
} }
} }
// // ,QMS()
const EnableQms = ref(true)
const isShowSourceTypeButton = (row) => { const isShowSourceTypeButton = (row) => {
if (EnableQms.value) {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') { if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true return true
} else { } else {
return false return false
} }
} else {
return true
}
} }
// - // -
const butttondata = (row, $index) => { const butttondata = (row, $index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) { if (findIndex > -1 && findIndex < $index) {
return [] return []
} }
return [ return [
defaultButtons.mainListJobAccBtn({ hide: isShowMainButton(row, ['1']) }), // defaultButtons.mainListJobAccBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), // defaultButtons.mainListJobCloBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchasereceipt-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'])}), //
{ {
@ -239,22 +272,26 @@ const butttondata = (row,$index) => {
hasPermi: 'wms:purchasereceipt-job-main:refusal', hasPermi: 'wms:purchasereceipt-job-main:refusal',
link: true // link: true //
}, },
// defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), // defaultButtons.mainListPlanCheckQualityReportBtn({ hide: isShowSourceTypeButton(row) }) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') { // if (val == 'mainJobExe') {
//
console.log('列表-操作按钮事件-执行') console.log('列表-操作按钮事件-执行')
} else if (val == 'mainJobAba') { // } else if (val == 'mainJobAba') {
//
console.log('列表-操作按钮事件-放弃') console.log('列表-操作按钮事件-放弃')
await PurchasereceiptJobMainApi.abandonPurchasereceiptJobMainSpare(row.masterId) await PurchasereceiptJobMainApi.abandonPurchasereceiptJobMainSpare(row.masterId)
buttonBaseClick('refresh', null) buttonBaseClick('refresh', null)
} else if (val == 'mainJobClo') { // } else if (val == 'mainJobClo') {
//
handleClose(row.masterId) handleClose(row.masterId)
buttonBaseClick('refresh', null) buttonBaseClick('refresh', null)
} else if (val == 'mainJobAcc') { // } else if (val == 'mainJobAcc') {
//
console.log('列表-操作按钮事件-承接') console.log('列表-操作按钮事件-承接')
await PurchasereceiptJobMainApi.acceptPurchasereceiptJobMain(row.masterId) await PurchasereceiptJobMainApi.acceptPurchasereceiptJobMain(row.masterId)
buttonBaseClick('refresh', null) buttonBaseClick('refresh', null)
@ -287,7 +324,6 @@ const handleClose = async (id: number) => {
} catch {} } catch {}
} }
const resonSubmit = async (row) => { const resonSubmit = async (row) => {
ElMessageBox.prompt(t('ts.请输入拒收原因'), t('ts.提示'), { ElMessageBox.prompt(t('ts.请输入拒收原因'), t('ts.提示'), {
confirmButtonText: t('common.ok'), confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'), cancelButtonText: t('common.cancel'),
@ -301,12 +337,12 @@ const resonSubmit = async (row)=>{
return true return true
} }
} }
}).then(({ value }) => { })
.then(({ value }) => {
//  // 
handleRefusal(row.masterId, value) handleRefusal(row.masterId, value)
}) })
.catch(() => { .catch(() => {})
})
} }
/** 拒收按钮操作 */ /** 拒收按钮操作 */
const handleRefusal = async (id: number, refuseReason: string) => { const handleRefusal = async (id: number, refuseReason: string) => {
@ -329,14 +365,16 @@ const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue, 'jobPurchasereceiptMain') detailRef.value.openDetail(row, titleName, titleValue, 'jobPurchasereceiptMain')
} }
// table // table
const buttondataTable = ref([{ const buttondataTable = ref([
{
label: '查看子包装', label: '查看子包装',
name: 'viewParentPickingNumber', name: 'viewParentPickingNumber',
hide: false, hide: false,
@ -344,12 +382,14 @@ const buttondataTable = ref([{
icon: '', icon: '',
color: '', color: '',
hasPermi: '', hasPermi: '',
link: true, // link: true //
}]) }
])
// //
const tableFormButton = async (val, row) => { const tableFormButton = async (val, row) => {
if (val == 'viewParentPickingNumber') { // if (val == 'viewParentPickingNumber') {
//
packingDetatableData.params = { packingDetatableData.params = {
masterId: row.masterId, masterId: row.masterId,
parentPackingNumber: row.packingNumber parentPackingNumber: row.packingNumber
@ -387,5 +427,8 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
}) })
</script> </script>

37
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMTypeMain/index.vue

@ -115,7 +115,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList' import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import {getJmreportBaseUrl, getReportUrl} from '@/utils/systemParam' import {getJmreportBaseUrl, getReportUrl} from '@/utils/systemParam'
import { getSwitchByCode } from '@/api/wms/switch'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import {mainListPointBtn, mainListPrintInspectionBtn} from "@/utils/disposition/defaultButtons"; import {mainListPointBtn, mainListPrintInspectionBtn} from "@/utils/disposition/defaultButtons";
@ -170,27 +170,45 @@ const buttonBaseClick = (val, item) => {
} }
} }
// // ,QMS()
const EnableQms = ref(true)
const isShowSourceTypeButton = (row) => { const isShowSourceTypeButton = (row) => {
if (EnableQms.value) {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') { if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true return true
} else { } else {
return false return false
} }
} else {
return true
}
}
// QMS()
const isShowSCPAndQMSButton = () => {
if (EnableQms.value) {
if (routeName.value.includes('SCP')) {
return true
} else {
return false
}
} else {
return true
}
} }
// - // -
const butttondata = (row,$index) => { const butttondata = (row,$index) => {
// const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
// if(findIndex>-1&&findIndex<$index){ if(findIndex>-1&&findIndex<$index){
// return [defaultButtons.mainListPrintInspectionBtn({hide:routeName.value.includes('SCP')})] return [defaultButtons.mainListPrintInspectionBtn({hide:isShowSCPAndQMSButton()})]
// } }
return [ return [
defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),// defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),// defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),//
//defaultButtons.mainListPlanCheckQualityReportBtn({hide:row.orderTypeM == "2"}), // //defaultButtons.mainListPlanCheckQualityReportBtn({hide:row.orderTypeM == "2"}), //
// defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), // defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), //
// defaultButtons.mainListPrintInspectionBtn({hide:routeName.value.includes('SCP')}) defaultButtons.mainListPrintInspectionBtn({hide:isShowSCPAndQMSButton()})
] ]
} }
@ -384,6 +402,9 @@ onMounted(async () => {
tableObject.params = { tableObject.params = {
orderTypeM : '2' orderTypeM : '2'
} }
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
getList() getList()
}) })
onActivated(() => { onActivated(() => {

199
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue

@ -1,7 +1,14 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...PurchasereceiptRecordMain.allSchemas.searchSchema,...PurchasereceiptRecordDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" /> <Search
:schema="[
...PurchasereceiptRecordMain.allSchemas.searchSchema,
...PurchasereceiptRecordDetail.allSchemas.searchSchema
]"
@search="searchList"
@reset="searchList"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -17,7 +24,8 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -34,7 +42,10 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row, $index }"> <template #action="{ row, $index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -98,28 +109,28 @@
> >
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe> <iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { PurchasereceiptRecordMain, import {
PurchasereceiptRecordMain,
PurchasereceiptRecordMainRules, PurchasereceiptRecordMainRules,
PurchasereceiptRecordDetail, PurchasereceiptRecordDetail,
PurchasereceiptRecordDetailRules, PurchasereceiptRecordDetailRules,
PurchasereceiptRecordDetailPackingNumber } from './purchasereceiptRecordMain.data' PurchasereceiptRecordDetailPackingNumber
} from './purchasereceiptRecordMain.data'
import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain' import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getSwitchByCode } from '@/api/wms/switch'
import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList' import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getJmreportBaseUrl, getReportUrl } from '@/utils/systemParam' import { getJmreportBaseUrl, getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import {mainListPointBtn, mainListPrintInspectionBtn} from "@/utils/disposition/defaultButtons"; import { mainListPointBtn, mainListPrintInspectionBtn } from '@/utils/disposition/defaultButtons'
import {getAccessToken} from "@/utils/auth"; import { getAccessToken } from '@/utils/auth'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// //
defineOptions({ name: 'PurchasereceiptRecordMain' }) defineOptions({ name: 'PurchasereceiptRecordMain' })
@ -128,8 +139,15 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const apiPage = ref(routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage) const apiPage = ref(
const tableColumns = ref([...PurchasereceiptRecordMain.allSchemas.tableColumns,...PurchasereceiptRecordDetail.allSchemas.tableMainColumns]) routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage
)
const tableColumns = ref([
...PurchasereceiptRecordMain.allSchemas.tableColumns,
...PurchasereceiptRecordDetail.allSchemas.tableMainColumns
])
const detailAllSchemas = ref(PurchasereceiptRecordDetail.allSchemas) const detailAllSchemas = ref(PurchasereceiptRecordDetail.allSchemas)
// //
@ -138,7 +156,9 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage // getListApi: routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage //
}) })
// //
@ -149,14 +169,16 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-record-main:export' }), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-record-main:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'export') { // if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) { if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({ searchFormClick({
filters: tableObject.params.filters filters: tableObject.params.filters
@ -164,51 +186,96 @@ const buttonBaseClick = (val, item) => {
} else { } else {
getList() getList()
} }
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// // ,QMS()
const EnableQms = ref(true)
const isShowSourceTypeButton = (row) => { const isShowSourceTypeButton = (row) => {
if (EnableQms.value) {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') { if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true return true
} else { } else {
return false return false
} }
} else {
return true
}
}
// QMS()
const isShowSCPAndQMSButton = () => {
if (EnableQms.value) {
if (routeName.value.includes('SCP')) {
return true
} else {
return false
}
} else {
return true
}
}
// QMS()
const isShowputawayRequestFlagButton = (row) => {
if (EnableQms.value) {
if (row.inspectRequestFlag == 'FALSE') {
return true
} else {
return false
}
} else {
return true
}
} }
// - // -
const butttondata = (row, $index) => { const butttondata = (row, $index) => {
// const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 const findIndex = row['masterId']
// if(findIndex>-1&&findIndex<$index){ ? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
// return [defaultButtons.mainListPrintInspectionBtn({hide:routeName.value.includes('SCP')})] : -1
// } if (findIndex > -1 && findIndex < $index) {
return [defaultButtons.mainListPrintInspectionBtn({ hide: isShowSCPAndQMSButton() })]
}
return [ return [
// defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),// defaultButtons.mainInspectRequestBtn({
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),// hasPermi: 'wms:purchasereceipt-record-main:createInspectRequest',
defaultButtons.mainPurchasereturnRecordBtn({hasPermi:'wms:purchasereceipt-record-main:createPurchasereturnRecord',hide:row.purchasereturnRecordFlag == "FALSE" }),// 退 hide: isShowputawayRequestFlagButton(row)
}), //
defaultButtons.mainPutawayRequestBtn({
hasPermi: 'wms:purchasereceipt-record-main:createPutawayRequest',
hide: row.putawayRequestFlag == 'FALSE'
}), //
defaultButtons.mainPurchasereturnRecordBtn({
hasPermi: 'wms:purchasereceipt-record-main:createPurchasereturnRecord',
hide: row.purchasereturnRecordFlag == 'FALSE'
}), // 退
//defaultButtons.mainListPlanCheckQualityReportBtn({hide:row.orderTypeM == "2"}), // //defaultButtons.mainListPlanCheckQualityReportBtn({hide:row.orderTypeM == "2"}), //
// defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), // defaultButtons.mainListPlanCheckQualityReportBtn({ hide: isShowSourceTypeButton(row) }), //
// defaultButtons.mainListPrintInspectionBtn({hide:routeName.value.includes('SCP')}) defaultButtons.mainListPrintInspectionBtn({ hide: isShowSCPAndQMSButton() })
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'putawayRequest') { // if (val == 'putawayRequest') {
//
handleCreatePutawayRequest(row.number) handleCreatePutawayRequest(row.number)
}else if(val == 'inspectRequest'){// } else if (val == 'inspectRequest') {
//
handleCreateInspectRequest(row.number) handleCreateInspectRequest(row.number)
}else if(val == 'purchasereturnRecord'){//退 } else if (val == 'purchasereturnRecord') {
//退
handleCreatePurchasereturnRecord(row.number) handleCreatePurchasereturnRecord(row.number)
} } else if (val == 'mainPlanCheckQualityReport') {
// else if(val == 'mainPlanCheckQualityReport'){ //
// // checkQualityReport(row)
// checkQualityReport(row) } else if (val == 'printInspection') {
// }
else if (val == 'printInspection'){
handlePrint(row) handlePrint(row)
} }
} }
@ -249,7 +316,8 @@ const handleCreatePutawayRequest = async (number:string) => {
await PurchasereceiptRecordMainApi.createPutawayRequest(number) await PurchasereceiptRecordMainApi.createPutawayRequest(number)
message.success(t('ts.上架申请生成成功')) message.success(t('ts.上架申请生成成功'))
buttonBaseClick('refresh', null) buttonBaseClick('refresh', null)
}catch{}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -262,7 +330,8 @@ const handleCreateInspectRequest = async (number:string) => {
await PurchasereceiptRecordMainApi.createInspectRequest(number) await PurchasereceiptRecordMainApi.createInspectRequest(number)
message.success(t('ts.到货检验申请生成成功')) message.success(t('ts.到货检验申请生成成功'))
buttonBaseClick('refresh', null) buttonBaseClick('refresh', null)
}catch{}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -275,7 +344,8 @@ const handleCreatePurchasereturnRecord = async (number:string) => {
await PurchasereceiptRecordMainApi.createPurchasereturnRecord(number) await PurchasereceiptRecordMainApi.createPurchasereturnRecord(number)
message.success(t('ts.采购退货记录生成成功')) message.success(t('ts.采购退货记录生成成功'))
buttonBaseClick('refresh', null) buttonBaseClick('refresh', null)
}catch{}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -287,10 +357,10 @@ const { tableObject: packingDetatableData, tableMethods: packDetatableMethods }
}) })
const { getList: queryDetailList } = packDetatableMethods const { getList: queryDetailList } = packDetatableMethods
// //
const outStockDetailParenPackingRef = ref() const outStockDetailParenPackingRef = ref()
const { tableObject: outStockPackingDetatableData, tableMethods: outStockPackDetatableMethods } = useTable({ const { tableObject: outStockPackingDetatableData, tableMethods: outStockPackDetatableMethods } =
useTable({
getListApi: PurchasereceiptRecordDetailApi.queryPurchaseshortageChildPackingNumber getListApi: PurchasereceiptRecordDetailApi.queryPurchaseshortageChildPackingNumber
}) })
const { getList: queryOutStockDetailList } = outStockPackDetatableMethods const { getList: queryOutStockDetailList } = outStockPackDetatableMethods
@ -299,13 +369,16 @@ const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue, 'recordPurchasereceiptMain') detailRef.value.openDetail(row, titleName, titleValue, 'recordPurchasereceiptMain')
} }
// table // table
const buttondataTable = ref([{ const buttondataTable = ref([
{
label: t('ts.查看子包装'), label: t('ts.查看子包装'),
name: 'viewParentPickingNumber', name: 'viewParentPickingNumber',
hide: false, hide: false,
@ -313,14 +386,15 @@ const buttondataTable = ref([{
icon: '', icon: '',
color: '', color: '',
hasPermi: '', hasPermi: '',
link: true, // link: true //
}]) }
])
const tabeKey = ref("receiptDetail"); const tabeKey = ref('receiptDetail')
// //
const tableFormButton = async (val, row) => { const tableFormButton = async (val, row) => {
if (val == 'viewParentPickingNumber' && tabeKey.value == 'receiptDetail') { // if (val == 'viewParentPickingNumber' && tabeKey.value == 'receiptDetail') {
//
packingDetatableData.params = { packingDetatableData.params = {
masterId: row.masterId, masterId: row.masterId,
parentPackingNumber: row.packingNumber parentPackingNumber: row.packingNumber
@ -328,7 +402,8 @@ const tableFormButton = async (val , row) => {
await queryDetailList() await queryDetailList()
detailParenPackingRef.value.open('create', row, null, 'viewDetail') // detailParenPackingRef.value.open('create', row, null, 'viewDetail') //
} }
if (val == 'viewParentPickingNumber' && tabeKey.value == 'scarceGoodsDetail') { // if (val == 'viewParentPickingNumber' && tabeKey.value == 'scarceGoodsDetail') {
//
outStockPackingDetatableData.params = { outStockPackingDetatableData.params = {
masterId: row.masterId, masterId: row.masterId,
parentPackingNumber: row.packingNumber parentPackingNumber: row.packingNumber
@ -347,10 +422,14 @@ const handleExport = async () => {
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
if (routeName.value.includes('SCP')) { if (routeName.value.includes('SCP')) {
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(tableObject.params) const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} else { } else {
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMain(tableObject.params) const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMain(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} }
} catch { } catch {
@ -361,13 +440,11 @@ const handleExport = async () => {
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
searchData.filters.push( searchData.filters.push({
{
action: '==', action: '==',
column: 'order_type_m', column: 'order_type_m',
value: '1' value: '1'
} })
)
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
@ -378,7 +455,9 @@ const searchFormClick = (searchData) => {
const changeTabs = (data) => { const changeTabs = (data) => {
if (data.prop == 'receiptDetail') { if (data.prop == 'receiptDetail') {
console.log(data) console.log(data)
apiPage.value = routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage apiPage.value = routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
tabeKey.value = 'receiptDetail' tabeKey.value = 'receiptDetail'
} else if (data.prop == 'scarceGoodsDetail') { } else if (data.prop == 'scarceGoodsDetail') {
@ -386,13 +465,12 @@ const changeTabs = (data) =>{
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
tabeKey.value = 'scarceGoodsDetail' tabeKey.value = 'scarceGoodsDetail'
} }
detailAllSchemas.value.tableColumns.forEach(item=>{ detailAllSchemas.value.tableColumns.forEach((item) => {
if (item['field'] == 'qty') { if (item['field'] == 'qty') {
item['label'] = data.prop == 'scarceGoodsDetail' ? '缺货数量' : '收货数量' item['label'] = data.prop == 'scarceGoodsDetail' ? '缺货数量' : '收货数量'
} }
}) })
console.log('detailAllSchemas', detailAllSchemas.value) console.log('detailAllSchemas', detailAllSchemas.value)
} }
@ -401,6 +479,9 @@ onMounted(async () => {
tableObject.params = { tableObject.params = {
orderTypeM: '1' orderTypeM: '1'
} }
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
getList() getList()
}) })
onActivated(() => { onActivated(() => {

155
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordRefuseMain/index.vue

@ -1,7 +1,14 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...PurchasereceiptRecordMain.allSchemas.searchSchema,...PurchasereceiptRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="[
...PurchasereceiptRecordMain.allSchemas.searchSchema,
...PurchasereceiptRecordDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -17,7 +24,8 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -34,7 +42,10 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row, $index }"> <template #action="{ row, $index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -98,22 +109,23 @@
> >
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe> <iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { PurchasereceiptRecordMain, import {
PurchasereceiptRecordMain,
PurchasereceiptRecordMainRules, PurchasereceiptRecordMainRules,
PurchasereceiptRecordDetail, PurchasereceiptRecordDetail,
PurchasereceiptRecordDetailRules, PurchasereceiptRecordDetailRules,
PurchasereceiptRecordDetailPackingNumber } from './purchasereceiptRecordMain.data' PurchasereceiptRecordDetailPackingNumber
} from './purchasereceiptRecordMain.data'
import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain' import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { PurchasereceiptRefuseRequestTabsList } from '@/utils/disposition/tabsList' import { PurchasereceiptRefuseRequestTabsList } from '@/utils/disposition/tabsList'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getSwitchByCode } from '@/api/wms/switch'
import { getReportUrl } from '@/utils/systemParam' import { getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
@ -125,8 +137,15 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const apiPage = ref(routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage) const apiPage = ref(
const tableColumns = ref([...PurchasereceiptRecordMain.allSchemas.tableColumns,...PurchasereceiptRecordDetail.allSchemas.tableMainColumns]) routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage
)
const tableColumns = ref([
...PurchasereceiptRecordMain.allSchemas.tableColumns,
...PurchasereceiptRecordDetail.allSchemas.tableMainColumns
])
const detailAllSchemas = ref(PurchasereceiptRecordDetail.allSchemas) const detailAllSchemas = ref(PurchasereceiptRecordDetail.allSchemas)
// //
@ -135,7 +154,9 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage // getListApi: routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage //
}) })
// //
@ -146,14 +167,16 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-record-main:export' }), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-record-main:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'export') { // if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) { if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({ searchFormClick({
filters: tableObject.params.filters filters: tableObject.params.filters
@ -161,36 +184,71 @@ const buttonBaseClick = (val, item) => {
} else { } else {
getList() getList()
} }
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// QMS()
const EnableQms = ref(true)
const isShowputawayRequestFlagButton = (row) => {
if (EnableQms.value) {
if (row.inspectRequestFlag == 'FALSE') {
return true
} else {
return false
}
} else {
return true
}
}
// QMS()
const isShowQMSButton = () => {
if (EnableQms.value) {
return false
} else {
return true
}
}
// - // -
const butttondata = (row, $index) => { const butttondata = (row, $index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) { if (findIndex > -1 && findIndex < $index) {
return [] return []
} }
return [ return [
defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),// defaultButtons.mainInspectRequestBtn({
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),// hasPermi: 'wms:purchasereceipt-record-main:createInspectRequest',
// defaultButtons.mainListPlanCheckQualityReportBtn({}), // hide: isShowputawayRequestFlagButton(row)
}), //
defaultButtons.mainPutawayRequestBtn({
hasPermi: 'wms:purchasereceipt-record-main:createPutawayRequest',
hide: row.putawayRequestFlag == 'FALSE'
}), //
defaultButtons.mainListPlanCheckQualityReportBtn({ hide: isShowQMSButton()}), //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'putawayRequest') { // if (val == 'putawayRequest') {
//
handleCreatePutawayRequest(row.number) handleCreatePutawayRequest(row.number)
}else if(val == 'inspectRequest'){// } else if (val == 'inspectRequest') {
//
handleCreateInspectRequest(row.number) handleCreateInspectRequest(row.number)
} }
// else if(val == 'mainPlanCheckQualityReport'){ else if(val == 'mainPlanCheckQualityReport'){
// // //
// checkQualityReport(row) checkQualityReport(row)
// } }
} }
// //
const showQualityReport = ref(false) const showQualityReport = ref(false)
@ -209,7 +267,8 @@ const handleCreatePutawayRequest = async (number:string) => {
await PurchasereceiptRecordMainApi.createPutawayRequest(number) await PurchasereceiptRecordMainApi.createPutawayRequest(number)
message.success(t('ts.上架申请生成成功')) message.success(t('ts.上架申请生成成功'))
buttonBaseClick('refresh', null) buttonBaseClick('refresh', null)
}catch{}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -222,12 +281,12 @@ const handleCreateInspectRequest = async (number:string) => {
await PurchasereceiptRecordMainApi.createInspectRequest(number) await PurchasereceiptRecordMainApi.createInspectRequest(number)
message.success(t('ts.到货检验申请生成成功')) message.success(t('ts.到货检验申请生成成功'))
buttonBaseClick('refresh', null) buttonBaseClick('refresh', null)
}catch{}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
// //
const detailParenPackingRef = ref() const detailParenPackingRef = ref()
const { tableObject: packingDetatableData, tableMethods: packDetatableMethods } = useTable({ const { tableObject: packingDetatableData, tableMethods: packDetatableMethods } = useTable({
@ -235,10 +294,10 @@ const { tableObject: packingDetatableData, tableMethods: packDetatableMethods }
}) })
const { getList: queryDetailList } = packDetatableMethods const { getList: queryDetailList } = packDetatableMethods
// //
const outStockDetailParenPackingRef = ref() const outStockDetailParenPackingRef = ref()
const { tableObject: outStockPackingDetatableData, tableMethods: outStockPackDetatableMethods } = useTable({ const { tableObject: outStockPackingDetatableData, tableMethods: outStockPackDetatableMethods } =
useTable({
getListApi: PurchasereceiptRecordDetailApi.queryPurchaseshortageChildPackingNumber getListApi: PurchasereceiptRecordDetailApi.queryPurchaseshortageChildPackingNumber
}) })
const { getList: queryOutStockDetailList } = outStockPackDetatableMethods const { getList: queryOutStockDetailList } = outStockPackDetatableMethods
@ -247,13 +306,16 @@ const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue, 'recordPurchasereceiptMain') detailRef.value.openDetail(row, titleName, titleValue, 'recordPurchasereceiptMain')
} }
// table // table
const buttondataTable = ref([{ const buttondataTable = ref([
{
label: t('ts.查看其他包装规格'), label: t('ts.查看其他包装规格'),
name: 'viewParentPickingNumber', name: 'viewParentPickingNumber',
hide: false, hide: false,
@ -261,14 +323,15 @@ const buttondataTable = ref([{
icon: '', icon: '',
color: '', color: '',
hasPermi: '', hasPermi: '',
link: true, // link: true //
}]) }
])
const tabeKey = ref("receiptDetail"); const tabeKey = ref('receiptDetail')
// //
const tableFormButton = async (val, row) => { const tableFormButton = async (val, row) => {
if (val == 'viewParentPickingNumber' && tabeKey.value == 'receiptDetail') { // if (val == 'viewParentPickingNumber' && tabeKey.value == 'receiptDetail') {
//
packingDetatableData.params = { packingDetatableData.params = {
masterId: row.masterId, masterId: row.masterId,
parentPackingNumber: row.packingNumber parentPackingNumber: row.packingNumber
@ -276,7 +339,8 @@ const tableFormButton = async (val , row) => {
await queryDetailList() await queryDetailList()
detailParenPackingRef.value.open('create', row, null, 'viewDetail') // detailParenPackingRef.value.open('create', row, null, 'viewDetail') //
} }
if (val == 'viewParentPickingNumber' && tabeKey.value == 'scarceGoodsDetail') { // if (val == 'viewParentPickingNumber' && tabeKey.value == 'scarceGoodsDetail') {
//
outStockPackingDetatableData.params = { outStockPackingDetatableData.params = {
masterId: row.masterId, masterId: row.masterId,
parentPackingNumber: row.packingNumber parentPackingNumber: row.packingNumber
@ -295,10 +359,14 @@ const handleExport = async () => {
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
if (routeName.value.includes('SCP')) { if (routeName.value.includes('SCP')) {
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(tableObject.params) const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} else { } else {
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordRefuseMain(tableObject.params) const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordRefuseMain(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} }
} catch { } catch {
@ -319,7 +387,9 @@ const searchFormClick = (searchData) => {
const changeTabs = (data) => { const changeTabs = (data) => {
if (data.prop == 'receiptDetail') { if (data.prop == 'receiptDetail') {
console.log(data) console.log(data)
apiPage.value = routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage apiPage.value = routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
tabeKey.value = 'receiptDetail' tabeKey.value = 'receiptDetail'
} else if (data.prop == 'scarceGoodsDetail') { } else if (data.prop == 'scarceGoodsDetail') {
@ -331,6 +401,9 @@ const changeTabs = (data) =>{
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
getList() getList()
}) })
</script> </script>

21
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -181,6 +181,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as SupplieritemApi from '@/api/wms/supplieritem' import * as SupplieritemApi from '@/api/wms/supplieritem'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { getSwitchByCode } from '@/api/wms/switch'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import { getJmreportBaseUrl } from '@/utils/systemParam' import { getJmreportBaseUrl } from '@/utils/systemParam'
@ -356,13 +357,18 @@ const isShowMainButton = (row,val) => {
} }
} }
// // ,QMS()
const EnableQms = ref(true)
const isShowSourceTypeButton = (row) => { const isShowSourceTypeButton = (row) => {
if (EnableQms.value) {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') { if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true return true
} else { } else {
return false return false
} }
} else {
return true
}
} }
// //
@ -415,7 +421,7 @@ const butttondata = (row,$index) => {
defaultButtons.mainListPointBtn({ hide: isASNShowMainButton(row, ['3','6','8']) }), // defaultButtons.mainListPointBtn({ hide: isASNShowMainButton(row, ['3','6','8']) }), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:purchasereceipt-request-main:handle'}), // defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:purchasereceipt-request-main:handle'}), //
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), // defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), //
// defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), // defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), //
] ]
} }
@ -461,10 +467,10 @@ const buttonTableClick = async (val, row) => {
// //
labelPrint(row) labelPrint(row)
} }
// else if(val == 'mainPlanCheckQualityReport'){ else if(val == 'mainPlanCheckQualityReport'){
// // //
// checkQualityReport(row) checkQualityReport(row)
// } }
} }
// //
const onChangeLabel =(field,e,row, index) => { const onChangeLabel =(field,e,row, index) => {
@ -902,6 +908,9 @@ const formFormDateChange = (field, val,row, index) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
getList() getList()
importTemplateData.templateUrl = await PurchasereceiptRequestMainApi.importTemplate() importTemplateData.templateUrl = await PurchasereceiptRequestMainApi.importTemplate()
}) })

Loading…
Cancel
Save