Browse Source

BUG修改

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

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

@ -1,32 +1,21 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="SupplierdeliverRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="SupplierdeliverRequestMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
:HeadButttondata="HeadButttondata" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
@button-base-click="buttonBaseClick" :allSchemas="SupplierdeliverRequestMain.allSchemas" />
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverRequestMain.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table <Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
: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:sort="tableObject.sort">
v-model:currentPage="tableObject.currentPage"
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>
@ -39,55 +28,36 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm ref="formRef" @success="getList" :rules="SupplierdeliverRequestMainRules"
ref="formRef" :formAllSchemas="SupplierdeliverRequestMain.allSchemas" :tableAllSchemas="SupplierdeliverRequestDetail.allSchemas"
@success="getList" :tableFormRules="SupplierdeliverRequestDetailRules" :tableData="tableData"
:rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas"
:tableAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:tableFormRules="SupplierdeliverRequestDetailRules"
:tableData="tableData"
:apiUpdate="SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain" :apiUpdate="SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain"
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain" :apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain" :isBusiness="true"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@handleAddTable="handleAddTable" @submitForm="submitForm" />
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas"
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"
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail" :apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail" :Echo="Echo"
:Echo="Echo" @searchTableSuccessDetail="searchTableSuccessDetail" />
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> :importTemplateData="importTemplateData" @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true"
:mode="2" />
<!-- 打印 --> <!-- 打印 -->
<el-dialog v-model="dialogVisible " :title="dialogTitle" width="60%" > <el-dialog v-model="dialogVisible " :title="dialogTitle" width="60%">
<Table <Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading"
: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:sort="detatableData.sort">
v-model:currentPage="detatableData.currentPage"
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>
@ -98,33 +68,33 @@
</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') {
// //
@ -135,32 +105,32 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })
} }
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => { 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 = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = [] const Echo = []
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage // getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
}) })
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:supplierdeliver-request-main:create'}), // defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierdeliver-request-main:create' }), //
defaultButtons.defaultImportBtn({hasPermi:'wms:supplierdeliver-request-main:import'}), // defaultButtons.defaultImportBtn({ hasPermi: 'wms:supplierdeliver-request-main:import' }), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplierdeliver-request-main:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -172,10 +142,10 @@ const HeadButttondata = [
// icon: 'Select', // icon: 'Select',
// color: '' // color: ''
// }, // },
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') { //
@ -188,46 +158,47 @@ const buttonBaseClick = (val, item) => {
} else { // } else { //
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// //
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
return false return false
} else { } else {
return true return true
} }
} }
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['6']) }), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['6']) }), //
defaultButtons.mainListEditBtn({hasPermi:'wms:supplierdeliver-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierdeliver-request-main:delete'}), // defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierdeliver-request-main:update' }), //
defaultButtons.mainListPointBtn(null), // defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:supplierdeliver-request-main:delete' }), //
defaultButtons.mainListDocumentPrintBtn(null), // // defaultButtons.mainListPointBtn(null), //
// defaultButtons.mainListDocumentPrintBtn(null), //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { // if (val == 'mainPurPlanOpe') { //
console.log('列表-操作按钮事件-关闭') handleOpe(row.id)
} else if (val == 'mainReAdd') { // } else if (val == 'mainPurPlanClo') {//
console.log('列表-操作按钮事件-重新添加') handleClo(row.id)
} else if (val == 'mainSubmit') { // } else if (val == 'mainPlanSub') { //
console.log('列表-操作按钮事件-提交审批') handleSub(row.id)
} else if (val == 'mainTurnDown') { // } else if (val == 'mainPlanApp') { //
console.log('列表-操作按钮事件-驳回') handleApp(row.id)
} else if (val == 'mainApprove') { // } else if (val == 'mainPlanTur') { //
console.log('列表-操作按钮事件-审批通过') handleTur(row.id)
} else if (val == 'edit') { // } else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
@ -237,23 +208,23 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'documentPrint') { // } else if (val == 'documentPrint') { //
handleDocumentPrint(row.id) handleDocumentPrint(row.id)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm = async (type : string, row ?: number) => {
tableData.value = [] // tableData.value = [] //
formRef.value.open(type, row) formRef.value.open(type, row)
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue) detailRef.value.openDetail(row, titleName, titleValue)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id : number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
@ -262,12 +233,79 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch {} } 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 exportLoading = ref(false) // const handleTur = async (id : number) => {
const handleExport = async () => { try {
//
await message.confirm('是否驳回所选中数据?')
//
await SupplierdeliverRequestMainApi.rejSupplierdeliverRequestMain(id)
message.success(t('驳回成功!'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try { try {
// //
await message.exportConfirm() await message.exportConfirm()
@ -279,143 +317,143 @@ const handleExport = async () => {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
} }
} }
// //
const {tableObject: detatableData,tableMethods: detatableMethods} =useTable({ const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage
}) })
const { getList:getDetailList } = detatableMethods const { getList: getDetailList } = detatableMethods
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns) const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns)
const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作'&& item.label != '创建者'&&item.label != '创建时间'&&item.label != '最后更新者'&&item.label != '最后更新时间') const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作' && item.label != '创建者' && item.label != '创建时间' && item.label != '最后更新者' && item.label != '最后更新时间')
const dialogVisible = ref(false) const dialogVisible = ref(false)
const isShow = ref(false) const isShow = ref(false)
const dialogTitle = ref('') const dialogTitle = ref('')
const closeDialog = () =>{ const closeDialog = () => {
dialogVisible.value =false dialogVisible.value = false
isShow.value = false isShow.value = false
} }
const BASE_URL = 'http://dev.ccwin-in.com:25110' const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken()) const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
// //
const handlePoint = async (row) => { const handlePoint = async (row) => {
tableObject.params = { tableObject.params = {
masterId: row.id, masterId: row.id,
} }
await getDetailList() await getDetailList()
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = row.number + '单据号' dialogTitle.value = row.number + '单据号'
} }
const print = async() => { const print = async () => {
// //
// const packageArray:any= ref([]) // const packageArray:any= ref([])
// let packageObject = { // let packageObject = {
// itemCode: '', // itemCode: '',
// itemName: '', // itemName: '',
// itemDesc1: '', // itemDesc1: '',
// itemDesc2: '', // itemDesc2: '',
// batch: '', // batch: '',
// altBatch: '', // altBatch: '',
// produceDate: '', // produceDate: '',
// validityDays: '', // validityDays: '',
// expireDate: '', // expireDate: '',
// uom: '', // uom: '',
// qty: '', // qty: '',
// altUom: '', // altUom: '',
// altQty: '', // altQty: '',
// convertRate: '', // convertRate: '',
// stdPackQty: '', // stdPackQty: '',
// stdPackUnit: '', // stdPackUnit: '',
// toWarehouseCode: '', // toWarehouseCode: '',
// toDockCode: '', // toDockCode: '',
// toLocationCode: '', // toLocationCode: '',
// supplierCode: '', // supplierCode: '',
// supplierItemCode: '', // supplierItemCode: '',
// poNumber: '', // poNumber: '',
// poLine: '', // poLine: '',
// rpNumber: '', // rpNumber: '',
// asnNumber: '', // asnNumber: '',
// } // }
// // // //
// await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({ // await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({
// number: detatableData.tableList[0].number // number: detatableData.tableList[0].number
// }).then(res => { // }).then(res => {
// detatableData.tableList.forEach(item => { // detatableData.tableList.forEach(item => {
// packageObject.itemCode=item.itemCode // packageObject.itemCode=item.itemCode
// packageObject.itemName=item.itemName // packageObject.itemName=item.itemName
// packageObject.itemDesc1=item.itemDesc1 // packageObject.itemDesc1=item.itemDesc1
// packageObject.itemDesc2=item.itemDesc2 // packageObject.itemDesc2=item.itemDesc2
// packageObject.batch=item.batch // packageObject.batch=item.batch
// packageObject.altBatch=item.altBatch // packageObject.altBatch=item.altBatch
// packageObject.produceDate=item.produceDate // packageObject.produceDate=item.produceDate
// packageObject.expireDate=item.expireDate // packageObject.expireDate=item.expireDate
// packageObject.uom=item.uom // packageObject.uom=item.uom
// packageObject.qty=item.qty // packageObject.qty=item.qty
// packageObject.stdPackQty=item.stdPackQty // packageObject.stdPackQty=item.stdPackQty
// packageObject.stdPackUnit=item.stdPackUnit // packageObject.stdPackUnit=item.stdPackUnit
// packageObject.convertRate=item.convertRate // packageObject.convertRate=item.convertRate
// packageObject.poNumber=item.poNumber // packageObject.poNumber=item.poNumber
// packageObject.poLine=item.poLine // packageObject.poLine=item.poLine
// packageObject.supplierCode=res.list[0].supplierCode // packageObject.supplierCode=res.list[0].supplierCode
// packageObject.rpNumber=res.list[0].ppNumber // packageObject.rpNumber=res.list[0].ppNumber
// packageArray.value.push(packageObject) // packageArray.value.push(packageObject)
// }) // })
// }) // })
// const barBasicArray:any =ref([]) // const barBasicArray:any =ref([])
// let barBasicObject = { // let barBasicObject = {
// type: '', // type: '',
// template: '', // template: '',
// status: '', // status: '',
// relateNumber: '', // relateNumber: '',
// barcodeString: '', // barcodeString: '',
// printTimes: '', // printTimes: '',
// lastPrintTime: '', // lastPrintTime: '',
// lastPrintUserId: '', // lastPrintUserId: '',
// lastPrintUserName: '', // lastPrintUserName: '',
// } // }
// // // //
// await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => { // await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => {
// res.list.forEach(item => { // res.list.forEach(item => {
// barBasicObject.type = 'PurchaseLabel' // barBasicObject.type = 'PurchaseLabel'
// barBasicObject.relateNumber = item.number // barBasicObject.relateNumber = item.number
// barBasicObject.status = 'NEW' // barBasicObject.status = 'NEW'
// barBasicArray.value.push(barBasicObject) // barBasicArray.value.push(barBasicObject)
// }) // })
// }) // })
// await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value))) // await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value)))
window.open(src.value+'&number='+detatableData.tableList[0].number) window.open(src.value + '&number=' + detatableData.tableList[0].number)
} }
// //
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken()) const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const handleDocumentPrint = async (id) => { const handleDocumentPrint = async (id) => {
window.open(documentSrc.value+'&id='+id) window.open(documentSrc.value + '&id=' + id)
} }
/** /**
* tableForm方法 * tableForm方法
*/ */
const tableFormKeys = {} const tableFormKeys = {}
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => { SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
const tableData = ref([]) const tableData = ref([])
// //
const handleAddTable = () => { const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
} }
// //
const handleDeleteTable = (item, index) => { const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1) tableData.value.splice(index, 1)
} }
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //
try { try {
if (formType === 'create') { if (formType === 'create') {
@ -431,37 +469,37 @@ const submitForm = async (formType, data) => {
} finally { } finally {
formRef.value.formLoading = false formRef.value.formLoading = false
} }
} }
/** 导入 */ /** 导入 */
const importFormRef = ref() const importFormRef = ref()
const handleImport = () => { const handleImport = () => {
importFormRef.value.open() importFormRef.value.open()
} }
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls' templateTitle: '供应商发货申请主导入模版.xls'
}) })
// //
const importSuccess = () => { const importSuccess = () => {
getList() getList()
} }
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
} }
getList() // getList() //
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate() importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
}) })
</script> </script>
Loading…
Cancel
Save