Browse Source

供应商发货申请 文档格式化

master
陈薪名 12 months ago
parent
commit
35c02b30e9
  1. 295
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

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

@ -16,13 +16,13 @@
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" 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)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
@ -38,8 +38,7 @@
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas"
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:detailAllSchemasRules="SupplierdeliverRequestDetailRules"
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas" :detailAllSchemasRules="SupplierdeliverRequestDetailRules"
:apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail"
:apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail"
:apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage"
@ -47,18 +46,16 @@
@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"
:pagination="{
<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">
<template #batch="{row}">
<template #batch="{ row }">
<el-input v-model="row.batch">{{ row.batch }}</el-input>
</template>
</Table>
@ -70,33 +67,33 @@
</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) => {
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) => {
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
//
@ -107,29 +104,29 @@
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
}
//
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 Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
//
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' }), //
@ -144,10 +141,10 @@
// icon: 'Select',
// color: ''
// },
]
]
//
const buttonBaseClick = (val, item) => {
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
@ -158,19 +155,19 @@
getList()
} else if (val == 'filtrate') { //
}
}
}
//
const isShowMainButton = (row, val) => {
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
}
// -
const butttondata = (row) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4']) }), //
@ -182,10 +179,10 @@
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListDocumentPrintBtn(null), //
]
}
}
// -
const buttonTableClick = async (val, row) => {
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') { //
handleOpe(row.id)
} else if (val == 'mainPurPlanClo') {//
@ -205,23 +202,23 @@
} else if (val == 'documentPrint') { //
handleDocumentPrint(row.id)
}
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
/** 添加/修改操作 */
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) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
@ -231,10 +228,10 @@
//
await getList()
} catch { }
}
}
/** 关闭按钮操作 */
const handleClo = async (id : number) => {
/** 关闭按钮操作 */
const handleClo = async (id: number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
@ -244,10 +241,10 @@
//
await getList()
} catch { }
}
}
/** 打开按钮操作 */
const handleOpe = async (id : number) => {
/** 打开按钮操作 */
const handleOpe = async (id: number) => {
try {
//
await message.confirm('是否打开所选中数据?')
@ -257,10 +254,10 @@
//
await getList()
} catch { }
}
}
/** 提交审批按钮操作 */
const handleSub = async (id : number) => {
/** 提交审批按钮操作 */
const handleSub = async (id: number) => {
try {
//
await message.confirm('是否提交审批所选中数据?')
@ -270,10 +267,10 @@
//
await getList()
} catch { }
}
}
/** 审批通过按钮操作 */
const handleApp = async (id : number) => {
/** 审批通过按钮操作 */
const handleApp = async (id: number) => {
try {
//
await message.confirm('是否审批通过所选中数据?')
@ -283,10 +280,10 @@
//
await getList()
} catch { }
}
}
/** 驳回按钮操作 */
const handleTur = async (id : number) => {
/** 驳回按钮操作 */
const handleTur = async (id: number) => {
try {
//
await message.confirm('是否驳回所选中数据?')
@ -296,11 +293,11 @@
//
await getList()
} catch { }
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
@ -312,27 +309,27 @@
} finally {
exportLoading.value = false
}
}
}
//
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({
//
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage
})
})
const { getList: getDetailList } = detatableMethods
const { getList: getDetailList } = detatableMethods
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns)
const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作' && item.label != '创建者' && item.label != '创建时间' && item.label != '最后更新者' && item.label != '最后更新时间')
const dialogVisible = ref(false)
const isShow = ref(false)
const dialogTitle = ref('')
const closeDialog = () => {
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 genLabel = async () => {
/** 生成标签按钮操作 */
const genLabel = async () => {
try {
//
await message.confirm('是否为此数据生成标签?')
@ -344,13 +341,13 @@
//
await getList()
} catch { }
}
}
const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
const genLabelId=ref();
//
const handlePoint = async (row) => {
const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
const genLabelId = ref();
//
const handlePoint = async (row) => {
tableObject.params = {
masterId: row.id,
}
@ -358,9 +355,9 @@
dialogVisible.value = true
dialogTitle.value = row.number + '单据号'
genLabelId.value = row.number
}
}
const print = async () => {
const print = async () => {
//
// const packageArray:any= ref([])
// let packageObject = {
@ -438,35 +435,35 @@
// })
// 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) => {
//
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 => {
*/
const tableFormKeys = {}
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
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)))
}
//
const handleDeleteTable = (item, index) => {
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
}
//
const submitForm = async (formType, data) => {
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
@ -482,37 +479,37 @@
} finally {
formRef.value.formLoading = false
}
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
}
//
const importTemplateData = reactive({
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
})
//
const importSuccess = () => {
//
const importSuccess = () => {
getList()
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
})
})
</script>

Loading…
Cancel
Save