Browse Source

BUG修改

master
yejiaxing 11 months ago
parent
commit
45015dd60a
  1. 848
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

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

@ -1,32 +1,21 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierdeliverRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="SupplierdeliverRequestMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverRequestMain.allSchemas"
/>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverRequestMain.allSchemas" />
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
}" 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>
@ -39,55 +28,36 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas"
:tableAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:tableFormRules="SupplierdeliverRequestDetailRules"
:tableData="tableData"
<BasicForm ref="formRef" @success="getList" :rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" :tableAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:tableFormRules="SupplierdeliverRequestDetailRules" :tableData="tableData"
:apiUpdate="SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain"
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain" :isBusiness="true"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" />
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SupplierdeliverRequestMain.allSchemas"
<Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas"
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:detailAllSchemasRules="SupplierdeliverRequestDetailRules"
:apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail"
:apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail"
:apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage"
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail" :Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import"
:importTemplateData="importTemplateData" @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true"
:mode="2" />
<!-- 打印 -->
<el-dialog v-model="dialogVisible " :title="dialogTitle" width="60%" >
<Table
:columns="detailListTableColumns"
:data="detatableData.tableList"
:loading="detatableData.loading"
<el-dialog v-model="dialogVisible " :title="dialogTitle" width="60%">
<Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading"
:pagination="{
total: detatableData.total
}"
v-model:pageSize="detatableData.pageSize"
v-model:currentPage="detatableData.currentPage"
v-model:sort="detatableData.sort"
>
}" v-model:pageSize="detatableData.pageSize" v-model:currentPage="detatableData.currentPage"
v-model:sort="detatableData.sort">
<template #batch="{row}">
<el-input v-model="row.batch">{{ row.batch }}</el-input>
</template>
@ -98,370 +68,438 @@
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import { SupplierdeliverRequestMain,SupplierdeliverRequestMainRules,SupplierdeliverRequestDetail,SupplierdeliverRequestDetailRules } from './supplierdeliverRequestMain.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import * as PackageApi from '@/api/wms/package'
// import * as BarbasicApi from '@/api/wms/barbasic'
//
defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
} else {
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import { SupplierdeliverRequestMain, SupplierdeliverRequestMainRules, SupplierdeliverRequestDetail, SupplierdeliverRequestDetailRules } from './supplierdeliverRequestMain.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import * as PackageApi from '@/api/wms/package'
// import * as BarbasicApi from '@/api/wms/barbasic'
//
defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
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 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') { //
} else { //
console.log('其他按钮', item)
//
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') { //
} else { //
console.log('其他按钮', item)
}
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
}
// -
const butttondata = (row) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListApproveBtn({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), //
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['6']) }), //
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['6']) }), //
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 == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
} 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 formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SupplierdeliverRequestMainApi.deleteSupplierdeliverRequestMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(setSearchParams)
download.excel(data, '供应商发货申请主.xls')
} catch {
} finally {
exportLoading.value = false
// -
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 {tableObject: detatableData,tableMethods: detatableMethods} =useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage
})
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 dialogVisible = ref(false)
const isShow = ref(false)
const dialogTitle = ref('')
const closeDialog = () =>{
dialogVisible.value =false
isShow.value = false
}
const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
//
const handlePoint = async (row) => {
tableObject.params = {
masterId: row.id,
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
await getDetailList()
dialogVisible.value = true
dialogTitle.value = row.number + '单据号'
}
const print = async() => {
//
// const packageArray:any= ref([])
// let packageObject = {
// itemCode: '',
// itemName: '',
// itemDesc1: '',
// itemDesc2: '',
// batch: '',
// altBatch: '',
// produceDate: '',
// validityDays: '',
// expireDate: '',
// uom: '',
// qty: '',
// altUom: '',
// altQty: '',
// convertRate: '',
// stdPackQty: '',
// stdPackUnit: '',
// toWarehouseCode: '',
// toDockCode: '',
// toLocationCode: '',
// supplierCode: '',
// supplierItemCode: '',
// poNumber: '',
// poLine: '',
// rpNumber: '',
// asnNumber: '',
// }
// //
// await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({
// number: detatableData.tableList[0].number
// }).then(res => {
// detatableData.tableList.forEach(item => {
// packageObject.itemCode=item.itemCode
// packageObject.itemName=item.itemName
// packageObject.itemDesc1=item.itemDesc1
// packageObject.itemDesc2=item.itemDesc2
// packageObject.batch=item.batch
// packageObject.altBatch=item.altBatch
// packageObject.produceDate=item.produceDate
// packageObject.expireDate=item.expireDate
// packageObject.uom=item.uom
// packageObject.qty=item.qty
// packageObject.stdPackQty=item.stdPackQty
// packageObject.stdPackUnit=item.stdPackUnit
// packageObject.convertRate=item.convertRate
// packageObject.poNumber=item.poNumber
// packageObject.poLine=item.poLine
// packageObject.supplierCode=res.list[0].supplierCode
// packageObject.rpNumber=res.list[0].ppNumber
// packageArray.value.push(packageObject)
// })
// })
// const barBasicArray:any =ref([])
// let barBasicObject = {
// type: '',
// template: '',
// status: '',
// relateNumber: '',
// barcodeString: '',
// printTimes: '',
// lastPrintTime: '',
// lastPrintUserId: '',
// lastPrintUserName: '',
// }
// //
// await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => {
// res.list.forEach(item => {
// barBasicObject.type = 'PurchaseLabel'
// barBasicObject.relateNumber = item.number
// barBasicObject.status = 'NEW'
// barBasicArray.value.push(barBasicObject)
// })
// })
// await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value)))
window.open(src.value+'&number='+detatableData.tableList[0].number)
}
//
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value+'&id='+id)
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain(data)
message.success(t('common.updateSuccess'))
/** 详情操作 */
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 {
//
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 { 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 dialogVisible = ref(false)
const isShow = ref(false)
const dialogTitle = ref('')
const closeDialog = () => {
dialogVisible.value = false
isShow.value = false
}
const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
//
const handlePoint = async (row) => {
tableObject.params = {
masterId: row.id,
}
formRef.value.dialogVisible = false
//
await getDetailList()
dialogVisible.value = true
dialogTitle.value = row.number + '单据号'
}
const print = async () => {
//
// const packageArray:any= ref([])
// let packageObject = {
// itemCode: '',
// itemName: '',
// itemDesc1: '',
// itemDesc2: '',
// batch: '',
// altBatch: '',
// produceDate: '',
// validityDays: '',
// expireDate: '',
// uom: '',
// qty: '',
// altUom: '',
// altQty: '',
// convertRate: '',
// stdPackQty: '',
// stdPackUnit: '',
// toWarehouseCode: '',
// toDockCode: '',
// toLocationCode: '',
// supplierCode: '',
// supplierItemCode: '',
// poNumber: '',
// poLine: '',
// rpNumber: '',
// asnNumber: '',
// }
// //
// await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({
// number: detatableData.tableList[0].number
// }).then(res => {
// detatableData.tableList.forEach(item => {
// packageObject.itemCode=item.itemCode
// packageObject.itemName=item.itemName
// packageObject.itemDesc1=item.itemDesc1
// packageObject.itemDesc2=item.itemDesc2
// packageObject.batch=item.batch
// packageObject.altBatch=item.altBatch
// packageObject.produceDate=item.produceDate
// packageObject.expireDate=item.expireDate
// packageObject.uom=item.uom
// packageObject.qty=item.qty
// packageObject.stdPackQty=item.stdPackQty
// packageObject.stdPackUnit=item.stdPackUnit
// packageObject.convertRate=item.convertRate
// packageObject.poNumber=item.poNumber
// packageObject.poLine=item.poLine
// packageObject.supplierCode=res.list[0].supplierCode
// packageObject.rpNumber=res.list[0].ppNumber
// packageArray.value.push(packageObject)
// })
// })
// const barBasicArray:any =ref([])
// let barBasicObject = {
// type: '',
// template: '',
// status: '',
// relateNumber: '',
// barcodeString: '',
// printTimes: '',
// lastPrintTime: '',
// lastPrintUserId: '',
// lastPrintUserName: '',
// }
// //
// await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => {
// res.list.forEach(item => {
// barBasicObject.type = 'PurchaseLabel'
// barBasicObject.relateNumber = item.number
// barBasicObject.status = 'NEW'
// barBasicArray.value.push(barBasicObject)
// })
// })
// await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value)))
window.open(src.value + '&number=' + detatableData.tableList[0].number)
}
//
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value + '&id=' + id)
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
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
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
//
const importSuccess = () => {
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
})
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
})
</script>
Loading…
Cancel
Save