Browse Source

BUG修改

master
yejiaxing 12 months ago
parent
commit
b8924119c5
  1. 4
      src/api/wms/supplierdeliverRequestMain/index.ts
  2. 892
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  3. 98
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/point.vue

4
src/api/wms/supplierdeliverRequestMain/index.ts

@ -87,6 +87,10 @@ export const rejSupplierdeliverRequestMain = async (id: number) => {
export const genLabel = async (id) => { export const genLabel = async (id) => {
return await request.post({ url: `/wms/supplierdeliver-request-main/genLabel?id=` + id }) return await request.post({ url: `/wms/supplierdeliver-request-main/genLabel?id=` + id })
} }
// 生成记录
export const genRecordsSupplierdeliverRequestMain = async (id) => {
return await request.post({ url: `/wms/supplierdeliver-request-main/genRecords?id=` + id })
}
// 导出供应商发货申请主 Excel // 导出供应商发货申请主 Excel
export const exportSupplierdeliverRequestMain = async (params) => { export const exportSupplierdeliverRequestMain = async (params) => {
return await request.download({ url: `/wms/supplierdeliver-request-main/export-excel`, params }) return await request.download({ url: `/wms/supplierdeliver-request-main/export-excel`, params })

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

@ -38,7 +38,8 @@
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas" <Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas"
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas" :detailAllSchemasRules="SupplierdeliverRequestDetailRules" :detailAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:detailAllSchemasRules="SupplierdeliverRequestDetailRules"
:apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail" :apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail"
:apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail" :apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail"
:apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage" :apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage"
@ -46,11 +47,13 @@
@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%"> <point ref='pointRef' :detailListTableColumns='detailListTableColumns' />
<!-- <el-dialog v-model="dialogVisible" :title="dialogTitle" width="60%">
<Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading" :pagination="{ <Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading" :pagination="{
total: detatableData.total total: detatableData.total
}" v-model:pageSize="detatableData.pageSize" v-model:currentPage="detatableData.currentPage" }" v-model:pageSize="detatableData.pageSize" v-model:currentPage="detatableData.currentPage"
@ -63,453 +66,472 @@
<el-button @click="genLabel()">生成标签</el-button> <el-button @click="genLabel()">生成标签</el-button>
<el-button @click="print">打印</el-button> <el-button @click="print">打印</el-button>
</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 { 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 point from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/point.vue'
// import * as BarbasicApi from '@/api/wms/barbasic' // import * as PackageApi from '@/api/wms/package'
// import * as BarbasicApi from '@/api/wms/barbasic'
//
defineOptions({ name: 'SupplierdeliverRequestMain' }) //
defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() //
const { t } = useI18n() // const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref() const route = useRoute() //
routeName.value = route.name const routeName = ref()
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns) routeName.value = route.name
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => { //
tableColumns.value = val const updataTableColumns = (val) => {
} tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { //
nextTick(() => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
if (type == 'tableForm') { nextTick(() => {
// if (type == 'tableForm') {
row[formField] = val[0][searchField] //
} else { 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 = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
} })
}) }
}
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { // const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
nextTick(() => { const Echo = []
const setV = {}
setV[formField] = val[0][searchField] const { tableObject, tableMethods } = useTable({
formRef.setValues(setV) getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
}) })
}
//
// const { getList, setSearchParams } = tableMethods
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = [] //
const HeadButttondata = [
const { tableObject, tableMethods } = useTable({ defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierdeliver-request-main:create' }), //
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage // defaultButtons.defaultImportBtn({ hasPermi: 'wms:supplierdeliver-request-main:import' }), //
}) defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
const { getList, setSearchParams } = tableMethods defaultButtons.defaultSetBtn(null), //
// {
// // label: '',
const HeadButttondata = [ // name: 'zdy',
defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierdeliver-request-main:create' }), // // hide: false,
defaultButtons.defaultImportBtn({ hasPermi: 'wms:supplierdeliver-request-main:import' }), // // type: 'primary',
defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), // // icon: 'Select',
defaultButtons.defaultFreshBtn(null), // // color: ''
defaultButtons.defaultFilterBtn(null), // // },
defaultButtons.defaultSetBtn(null), // ]
// {
// label: '', //
// name: 'zdy', const buttonBaseClick = (val, item) => {
// hide: false, if (val == 'add') { //
// type: 'primary', openForm('create')
// icon: 'Select', } else if (val == 'import') { //
// color: '' handleImport()
// }, } else if (val == 'export') { //
] handleExport()
} else if (val == 'refresh') { //
// getList()
const buttonBaseClick = (val, item) => { } else if (val == 'filtrate') { //
if (val == 'add') { // }
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} }
}
//
// 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.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), // defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '4']) }), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4']) }), // defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), // defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), // defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierdeliver-request-main:update' }), //
defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierdeliver-request-main:update' }), // defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:supplierdeliver-request-main:delete' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:supplierdeliver-request-main:delete' }), // defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListPointBtn(null), // defaultButtons.mainListDocumentPrintBtn(null), //
defaultButtons.mainListDocumentPrintBtn(null), // //
] {
} label: '处理',
name: 'genRecords',
// - hide: isShowMainButton(row, ['3']),
const buttonTableClick = async (val, row) => { type: 'primary',
if (val == 'mainPurPlanOpe') { // icon: '',
handleOpe(row.id) color: '',
} else if (val == 'mainPurPlanClo') {// hasPermi: '',
handleClo(row.id) link: true, //
} 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 buttonTableClick = async (val, row) => {
const formRef = ref() if (val == 'mainPurPlanOpe') { //
const openForm = async (type: string, row?: number) => { handleOpe(row.id)
tableData.value = [] // } else if (val == 'mainPurPlanClo') {//
formRef.value.open(type, row) handleClo(row.id)
} } else if (val == 'mainPlanSub') { //
handleSub(row.id)
/** 详情操作 */ } else if (val == 'mainPlanApp') { //
const detailRef = ref() handleApp(row.id)
const openDetail = (row: any, titleName: any, titleValue: any) => { } else if (val == 'mainPlanTur') { //
detailRef.value.openDetail(row, titleName, titleValue) handleTur(row.id)
} }else if (val == 'genRecords') { //
genRecords(row.id)
/** 删除按钮操作 */ }else if (val == 'edit') { //
const handleDelete = async (id: number) => { openForm('update', row)
try { } else if (val == 'delete') { //
// handleDelete(row.id)
await message.delConfirm() } else if (val == 'point') { //
// handlePoint(row)
await SupplierdeliverRequestMainApi.deleteSupplierdeliverRequestMain(id) } else if (val == 'documentPrint') { //
message.success(t('common.delSuccess')) handleDocumentPrint(row.id)
// }
await getList() }
} catch { }
} /** 详情操作 */
const detailRef = ref()
/** 关闭按钮操作 */ const openDetail = (row : any, titleName : any, titleValue : any) => {
const handleClo = async (id: number) => { detailRef.value.openDetail(row, titleName, titleValue)
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 formRef = ref()
// const openForm = async (type: string, row?: number) => {
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({ tableData.value = [] //
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage formRef.value.open(type, row)
}) }
const { getList: getDetailList } = detatableMethods /** 删除按钮操作 */
const handleDelete = async (id : number) => {
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns) try {
const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作' && item.label != '创建者' && item.label != '创建时间' && item.label != '最后更新者' && item.label != '最后更新时间') //
const dialogVisible = ref(false) await message.delConfirm()
const isShow = ref(false) //
const dialogTitle = ref('') await SupplierdeliverRequestMainApi.deleteSupplierdeliverRequestMain(id)
const closeDialog = () => { message.success(t('common.delSuccess'))
dialogVisible.value = false //
isShow.value = false await getList()
} } catch { }
}
/** 生成标签按钮操作 */
const genLabel = async () => { /** 关闭按钮操作 */
try { const handleClo = async (id : number) => {
// try {
await message.confirm('是否为此数据生成标签?') //
// await message.confirm('是否关闭所选中数据?')
await SupplierdeliverRequestMainApi.genLabel(genLabelId.value) //
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 genRecords = async (id : number) => {
try {
//
await message.confirm('是否处理所选中数据?')
//
await SupplierdeliverRequestMainApi.genRecordsSupplierdeliverRequestMain(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 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 dialogVisible.value = false
isShow.value = false isShow.value = false
message.success(t('生成标签成功!'))
//
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) => {
tableObject.params = {
masterId: row.id,
} }
await getDetailList()
dialogVisible.value = true /** 生成标签按钮操作 */
dialogTitle.value = row.number + '单据号' const genLabel = async () => {
genLabelId.value = row.number try {
} //
await message.confirm('是否为此数据生成标签?')
const print = async () => { //
// await SupplierdeliverRequestMainApi.genLabel(genLabelId.value)
// const packageArray:any= ref([]) dialogVisible.value = false
// let packageObject = { isShow.value = false
// itemCode: '', message.success(t('生成标签成功!'))
// itemName: '', //
// itemDesc1: '', await getList()
// itemDesc2: '', } catch { }
// batch: '', }
// altBatch: '',
// produceDate: '', const BASE_URL = 'http://dev.ccwin-in.com:25110'
// validityDays: '', const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
// expireDate: '', const genLabelId = ref();
// uom: '', //
// qty: '', const pointRef = ref()
// altUom: '', const handlePoint = async (row) => {
// altQty: '',
// convertRate: '', pointRef.value.openPoint(row.id)
// stdPackQty: '', // console.log(tableObject.params);
// stdPackUnit: '', // dialogVisible.value = true
// toWarehouseCode: '', // dialogTitle.value = row.number + ''
// toDockCode: '', // genLabelId.value = row.number
// toLocationCode: '', }
// supplierCode: '',
// supplierItemCode: '', const print = async () => {
// poNumber: '', //
// poLine: '', // const packageArray:any= ref([])
// rpNumber: '', // let packageObject = {
// asnNumber: '', // itemCode: '',
// } // itemName: '',
// // // itemDesc1: '',
// await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({ // itemDesc2: '',
// number: detatableData.tableList[0].number // batch: '',
// }).then(res => { // altBatch: '',
// detatableData.tableList.forEach(item => { // produceDate: '',
// packageObject.itemCode=item.itemCode // validityDays: '',
// packageObject.itemName=item.itemName // expireDate: '',
// packageObject.itemDesc1=item.itemDesc1 // uom: '',
// packageObject.itemDesc2=item.itemDesc2 // qty: '',
// packageObject.batch=item.batch // altUom: '',
// packageObject.altBatch=item.altBatch // altQty: '',
// packageObject.produceDate=item.produceDate // convertRate: '',
// packageObject.expireDate=item.expireDate // stdPackQty: '',
// packageObject.uom=item.uom // stdPackUnit: '',
// packageObject.qty=item.qty // toWarehouseCode: '',
// packageObject.stdPackQty=item.stdPackQty // toDockCode: '',
// packageObject.stdPackUnit=item.stdPackUnit // toLocationCode: '',
// packageObject.convertRate=item.convertRate // supplierCode: '',
// packageObject.poNumber=item.poNumber // supplierItemCode: '',
// packageObject.poLine=item.poLine // poNumber: '',
// packageObject.supplierCode=res.list[0].supplierCode // poLine: '',
// packageObject.rpNumber=res.list[0].ppNumber // rpNumber: '',
// packageArray.value.push(packageObject) // asnNumber: '',
// }) // }
// }) // //
// const barBasicArray:any =ref([]) // await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({
// let barBasicObject = { // number: detatableData.tableList[0].number
// type: '', // }).then(res => {
// template: '', // detatableData.tableList.forEach(item => {
// status: '', // packageObject.itemCode=item.itemCode
// relateNumber: '', // packageObject.itemName=item.itemName
// barcodeString: '', // packageObject.itemDesc1=item.itemDesc1
// printTimes: '', // packageObject.itemDesc2=item.itemDesc2
// lastPrintTime: '', // packageObject.batch=item.batch
// lastPrintUserId: '', // packageObject.altBatch=item.altBatch
// lastPrintUserName: '', // packageObject.produceDate=item.produceDate
// } // packageObject.expireDate=item.expireDate
// // // packageObject.uom=item.uom
// await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => { // packageObject.qty=item.qty
// res.list.forEach(item => { // packageObject.stdPackQty=item.stdPackQty
// barBasicObject.type = 'PurchaseLabel' // packageObject.stdPackUnit=item.stdPackUnit
// barBasicObject.relateNumber = item.number // packageObject.convertRate=item.convertRate
// barBasicObject.status = 'NEW' // packageObject.poNumber=item.poNumber
// barBasicArray.value.push(barBasicObject) // packageObject.poLine=item.poLine
// }) // packageObject.supplierCode=res.list[0].supplierCode
// }) // packageObject.rpNumber=res.list[0].ppNumber
// await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value))) // packageArray.value.push(packageObject)
window.open(src.value + '&number=' + detatableData.tableList[0].number) // })
} // })
// const barBasicArray:any =ref([])
// // let barBasicObject = {
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken()) // type: '',
const handleDocumentPrint = async (id) => { // template: '',
window.open(documentSrc.value + '&id=' + id) // status: '',
} // relateNumber: '',
// barcodeString: '',
/** // printTimes: '',
* tableForm方法 // lastPrintTime: '',
*/ // lastPrintUserId: '',
const tableFormKeys = {} // lastPrintUserName: '',
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => { // }
// //
tableFormKeys[item.field] = item.default ? item.default : '' // await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => {
}) // res.list.forEach(item => {
const tableData = ref([]) // barBasicObject.type = 'PurchaseLabel'
// barBasicObject.relateNumber = item.number
// // barBasicObject.status = 'NEW'
const handleAddTable = () => { // barBasicArray.value.push(barBasicObject)
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) // })
} // })
// // await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value)))
const handleDeleteTable = (item, index) => { window.open(src.value + '&number=' + detatableData.tableList[0].number)
tableData.value.splice(index, 1) }
}
//
// const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const submitForm = async (formType, data) => { const handleDocumentPrint = async (id) => {
data.subList = tableData.value // window.open(documentSrc.value + '&id=' + id)
try { }
if (formType === 'create') {
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data) /**
message.success(t('common.createSuccess')) * tableForm方法
} else { */
await SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain(data) const tableFormKeys = {}
message.success(t('common.updateSuccess')) 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
} }
formRef.value.dialogVisible = false }
//
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
//
const importSuccess = () => {
getList() getList()
} finally {
formRef.value.formLoading = false
} }
}
//
/** 导入 */ const searchFormClick = (searchData) => {
const importFormRef = ref() tableObject.params = {
const handleImport = () => { isSearch: true,
importFormRef.value.open() filters: searchData.filters
} }
getList() //
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
} }
getList() //
} /** 初始化 **/
onMounted(async () => {
/** 初始化 **/ getList()
onMounted(async () => { importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
getList() })
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
})
</script> </script>

98
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/point.vue

@ -0,0 +1,98 @@
<template>
<!-- 打印 -->
<el-dialog v-model="dialogVisiblePoint" :title="dialogTitle" width="60%">
<Table :columns="detailListTableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort">
<template #batch="{ row }">
<el-input v-model="row.batch">{{ row.batch }}</el-input>
</template>
</Table>
<el-button @click="closeDialog">关闭</el-button>
<el-button @click="genLabel()">生成标签</el-button>
<el-button @click="print">打印</el-button>
</el-dialog>
</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'
const props = defineProps({
//
detailListTableColumns: {
type: Array,
required: true,
default: null
},
})
//
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 dialogVisiblePoint = ref(false)
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage //
})
const dialogVisible = ref(false)
const isShow = ref(false)
const dialogTitle = ref('')
const closeDialog = () => {
dialogVisiblePoint.value = false
isShow.value = false
}
// const print = async () => {
// window.open(src.value + '&number=' + detatableData.tableList[0].number)
// }
/** 生成标签按钮操作 */
const genLabel = async () => {
try {
//
await message.confirm('是否为此数据生成标签?')
//
await SupplierdeliverRequestMainApi.genLabel(genLabelId.value)
dialogVisible.value = false
isShow.value = false
message.success(t('生成标签成功!'))
dialogVisiblePoint.value = false
isShow.value = false
//
await getList()
} catch { }
}
//
const { getList, setSearchParams } = tableMethods
const genLabelId = ref();
const openPoint = async (masterId)=>{
tableObject.params = {
masterId:masterId,
}
dialogVisiblePoint.value = true
genLabelId.value = masterId
getList()
}
defineExpose({ openPoint }) // open
/** 初始化 **/
onMounted(async () => {
})
</script>
Loading…
Cancel
Save