add:中鼎接口对接

This commit is contained in:
zhangzq
2026-10-26 16:57:59 +08:00
parent 0fa93bd259
commit 1ff93f38f8
29 changed files with 972 additions and 61 deletions

View File

@@ -32,6 +32,18 @@
>
物料打印
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-s-promotion"
size="mini"
:loading="pushZdLoading"
:disabled="!crud.selections || crud.selections.length === 0"
@click="pushZd"
>
下推同步至中鼎
</el-button>
<el-button
slot="right"
class="filter-item"
@@ -274,6 +286,7 @@ export default {
classes2: [],
classes3: [],
fullscreenLoading: false,
pushZdLoading: false,
uploadShow: false,
measure_unit: [],
productSeries: [],
@@ -323,6 +336,27 @@ export default {
this.crud.notify('同步成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
},
pushZd() {
const selections = this.crud.selections || []
if (!selections.length) {
this.crud.notify('请至少选择一条物料', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const codes = selections.map(item => item.material_code).join('、')
this.$confirm('确认将以下 ' + selections.length + ' 条物料下推同步至中鼎?\n' + codes, '下推同步至中鼎', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushZdLoading = true
crudMaterial.pushZd(selections.map(item => item.material_id)).then(() => {
this.crud.notify('下推同步至中鼎成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.pushZdLoading = false
}).catch(() => {
this.pushZdLoading = false
})
}).catch(() => {})
},
openPrintDialog() {
const selections = this.crud.selections || []
if (selections.length !== 1) {

View File

@@ -55,6 +55,14 @@ export function materialSync(data) {
})
}
export function pushZd(ids) {
return request({
url: 'api/Materia/pushZd',
method: 'post',
data: ids
})
}
export function excelImport(data) {
return request({
url: 'api/Materia/importExcel',
@@ -62,4 +70,4 @@ export function excelImport(data) {
data
})
}
export default { add, edit, del, excelImport, getMaterOptType, isAlongMaterType, getProductSeries, materialSync }
export default { add, edit, del, excelImport, getMaterOptType, isAlongMaterType, getProductSeries, materialSync, pushZd }

View File

@@ -40,6 +40,17 @@
:disabled="crud.selections.length === 0"
@click="usualInboundBatch"
>批量入平库</el-button>
<el-button
v-if="canPushZd"
slot="right"
class="filter-item"
type="warning"
icon="el-icon-s-promotion"
size="mini"
:loading="pushZdLoading"
:disabled="crud.selections.length === 0"
@click="pushZd"
>下推中鼎WMS</el-button>
<el-button
slot="right"
class="filter-item"
@@ -130,6 +141,7 @@ export default {
mstrow: {},
printPreviewVisible: false,
batchInboundLoading: false,
pushZdLoading: false,
statusOptions: [
{ value: 'CREATED', label: '已创建' },
{ value: 'POSTED', label: '已下发' },
@@ -144,6 +156,9 @@ export default {
const url = (this.crud && this.crud.url) || ''
const seg = url.split('/').filter(Boolean)
return seg.length ? seg[seg.length - 1] : ''
},
canPushZd() {
return this.billType === 'PURCHASE_IN' || this.billType === 'SUBCONTRACT_RETURN_IN'
}
},
methods: {
@@ -199,6 +214,35 @@ export default {
})
}).catch(() => {})
},
pushZd() {
const selections = this.crud.selections
if (!selections.length) {
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const invalid = selections.filter(item => item.status !== 'CREATED')
if (invalid.length) {
this.crud.notify('仅已创建状态的单据可下推中鼎WMS', CRUD.NOTIFICATION_TYPE.WARNING)
return
}
const nos = selections.map(item => item.mblnr).join('、')
const title = (this.crud && this.crud.title) || '单据'
this.$confirm('确认将以下 ' + selections.length + ' 张' + title + '下推中鼎WMS?\n' + nos, '下推中鼎WMS', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushZdLoading = true
this.api.pushZd(selections.map(item => item.id)).then(() => {
this.crud.notify('下推中鼎WMS成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.refresh()
this.pushZdLoading = false
}).catch(() => {
this.pushZdLoading = false
this.crud.refresh()
})
}).catch(() => {})
},
printBill() {
const selections = this.crud.selections
if (!selections.length) {

View File

@@ -38,6 +38,17 @@
:disabled="isPushDisabled()"
@click="handlePush"
>下推出库</el-button>
<el-button
v-if="canPushZd"
slot="right"
class="filter-item"
type="warning"
icon="el-icon-s-promotion"
size="mini"
:loading="pushZdLoading"
:disabled="crud.selections.length === 0"
@click="pushZd"
>下推中鼎WMS</el-button>
</crudOperation>
<el-table
ref="table"
@@ -109,6 +120,7 @@ export default {
viewShow: false,
mstrow: {},
multipleSelection: [],
pushZdLoading: false,
statusOptions: [
{ value: 'CREATED', label: '已创建' },
{ value: 'POSTED', label: '已下发' },
@@ -117,6 +129,16 @@ export default {
]
}
},
computed: {
billType() {
const url = (this.crud && this.crud.url) || ''
const seg = url.split('/').filter(Boolean)
return seg.length ? seg[seg.length - 1] : ''
},
canPushZd() {
return this.billType === 'TRANSFER_OUT'
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
if (this.query.datepick && this.query.datepick.length) {
@@ -164,6 +186,35 @@ export default {
this.crud.toQuery()
})
}).catch(() => {})
},
pushZd() {
const selections = this.crud.selections
if (!selections.length) {
this.crud.notify('请至少选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const invalid = selections.filter(item => item.status !== 'CREATED')
if (invalid.length) {
this.crud.notify('仅已创建状态的单据可下推中鼎WMS', CRUD.NOTIFICATION_TYPE.WARNING)
return
}
const nos = selections.map(item => item.mblnr).join('、')
const title = (this.crud && this.crud.title) || '单据'
this.$confirm('确认将以下 ' + selections.length + ' 张' + title + '下推中鼎WMS?\n' + nos, '下推中鼎WMS', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushZdLoading = true
this.api.pushZd(selections.map(item => item.id)).then(() => {
this.crud.notify('下推中鼎WMS成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.refresh()
this.pushZdLoading = false
}).catch(() => {
this.pushZdLoading = false
this.crud.refresh()
})
}).catch(() => {})
}
}
}

View File

@@ -20,7 +20,10 @@ export function createMaterialDocumentApi(billType) {
function outPush(data) {
return request({ url: base + '/outPush', method: 'post', data })
}
return { add, edit, del, get, print, outPush }
function pushZd(ids) {
return request({ url: base + '/pushZd', method: 'post', data: ids })
}
return { add, edit, del, get, print, outPush, pushZd }
}
/**

View File

@@ -34,6 +34,16 @@
<rrOperation />
</el-form>
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-s-promotion"
size="mini"
:loading="pushZdLoading"
:disabled="multipleSelection.length === 0"
@click="pushZd"
>下推中鼎WMS</el-button>
<el-button
v-if="enableReturnConfirm"
slot="right"
@@ -46,7 +56,7 @@
>退货确认</el-button>
</crudOperation>
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" border row-key="id" @selection-change="handleSelectionChange">
<el-table-column v-if="enableReturnConfirm" type="selection" width="55" />
<el-table-column type="selection" width="55" />
<el-table-column prop="vbeln" label="交货单号" min-width="130" show-overflow-tooltip>
<template slot-scope="scope">
<el-link type="primary" @click="openDetailDialog(scope.row)">{{ scope.row.vbeln }}</el-link>
@@ -118,6 +128,7 @@ export default {
pageTitle: '',
fixedBillType: '',
enableReturnConfirm: false,
pushZdLoading: false,
multipleSelection: [],
permission: {
add: ['admin', 'sapOutboundDelivery:add'],
@@ -174,6 +185,35 @@ export default {
}
return this.multipleSelection[0].status !== 'CREATED'
},
pushZd() {
const selections = this.multipleSelection
if (!selections.length) {
this.$message.info('请至少选择一条单据')
return
}
const invalid = selections.filter(item => item.status !== 'CREATED')
if (invalid.length) {
this.$message.warning('仅已创建状态的单据可下推中鼎WMS')
return
}
const nos = selections.map(item => item.vbeln).join('、')
const title = this.pageTitle || '单据'
this.$confirm('确认将以下 ' + selections.length + ' 张' + title + '下推中鼎WMS?\n' + nos, '下推中鼎WMS', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushZdLoading = true
this.api.pushZd(selections.map(item => item.id)).then(() => {
this.$message.success('下推中鼎WMS成功')
this.crud.toQuery()
this.pushZdLoading = false
}).catch(() => {
this.pushZdLoading = false
this.crud.toQuery()
})
}).catch(() => {})
},
handleReturnConfirm() {
if (this.isReturnConfirmDisabled()) {
this.$message.warning('请勾选一张已创建状态的交货单')

View File

@@ -36,6 +36,16 @@
:disabled="isPushDisabled()"
@click="handlePush"
>下推出库</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-s-promotion"
size="mini"
:loading="pushZdLoading"
:disabled="multipleSelection.length === 0"
@click="pushZd"
>下推中鼎WMS</el-button>
</crudOperation>
<el-table
ref="table"
@@ -134,6 +144,7 @@ export default {
{ value: 'SALES_OUT', label: '原材料销售出库' },
{ value: 'SALES_RETURN_IN', label: '原材料销售退货' }
],
pushZdLoading: false,
multipleSelection: [],
detailVisible: false,
detailLoading: false,
@@ -190,6 +201,35 @@ export default {
})
}).catch(() => {})
},
pushZd() {
const selections = this.multipleSelection
if (!selections.length) {
this.$message.info('请至少选择一条单据')
return
}
const invalid = selections.filter(item => item.status !== 'CREATED')
if (invalid.length) {
this.$message.warning('仅已创建状态的单据可下推中鼎WMS')
return
}
const nos = selections.map(item => item.vbeln).join('、')
const title = this.pageTitle || '单据'
this.$confirm('确认将以下 ' + selections.length + ' 张' + title + '下推中鼎WMS?\n' + nos, '下推中鼎WMS', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushZdLoading = true
this.api.pushZd(selections.map(item => item.id)).then(() => {
this.$message.success('下推中鼎WMS成功')
this.crud.toQuery()
this.pushZdLoading = false
}).catch(() => {
this.pushZdLoading = false
this.crud.toQuery()
})
}).catch(() => {})
},
openDetailDialog(row) {
this.currentOrder = { ...row }
this.detailVisible = true

View File

@@ -36,6 +36,16 @@
:disabled="isPushDisabled()"
@click="handlePush"
>下推出库</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-s-promotion"
size="mini"
:loading="pushZdLoading"
:disabled="multipleSelection.length === 0"
@click="handlePushZd"
>下推中鼎WMS</el-button>
<el-button
slot="right"
class="filter-item"
@@ -260,7 +270,7 @@
</template>
<script>
import crudOutboundDelivery, { getDetail, outPush, reverse } from './outBoundDelivery'
import crudOutboundDelivery, { getDetail, outPush, pushZd, reverse } from './outBoundDelivery'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation.vue'
import udOperation from '@crud/UD.operation.vue'
@@ -325,6 +335,7 @@ export default {
{ value: 'SALES_RETURN_IN', label: '原材料销售退货' }
],
storageOnlyBilltypes: ['TRANSFER_IN', 'SALES_RETURN_IN'],
pushZdLoading: false,
multipleSelection: [],
detailVisible: false,
detailLoading: false,
@@ -459,6 +470,34 @@ export default {
})
}).catch(() => {})
},
handlePushZd() {
const selections = this.multipleSelection
if (!selections.length) {
this.$message.info('请至少选择一条单据')
return
}
const invalid = selections.filter(item => item.status !== 'CREATED')
if (invalid.length) {
this.$message.warning('仅已创建状态的单据可下推中鼎WMS')
return
}
const nos = selections.map(item => item.vbeln).join('、')
this.$confirm('确认将以下 ' + selections.length + ' 张SAP委外交货单下推中鼎WMS?\n' + nos, '下推中鼎WMS', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushZdLoading = true
pushZd(selections.map(item => item.id)).then(() => {
this.$message.success('下推中鼎WMS成功')
this.crud.toQuery()
this.pushZdLoading = false
}).catch(() => {
this.pushZdLoading = false
this.crud.toQuery()
})
}).catch(() => {})
},
openReverseDialog() {
if (this.isReverseDisabled()) {
const row = this.multipleSelection[0]

View File

@@ -47,6 +47,14 @@ export function outPush(data) {
})
}
export function pushZd(ids) {
return request({
url: 'api/sapOutboundDelivery/pushZd',
method: 'post',
data: ids
})
}
export function reverse(data) {
return request({
url: 'api/sapOutboundDelivery/reverse',
@@ -55,4 +63,4 @@ export function reverse(data) {
})
}
export default { add, edit, del, get, getDetail, outPush, reverse }
export default { add, edit, del, get, getDetail, outPush, pushZd, reverse }

View File

@@ -17,5 +17,8 @@ export function createOutboundDeliveryBillApi(billType) {
function returnConfirm(data) {
return request({ url: base + '/returnConfirm', method: 'post', data })
}
return { del, edit, get, outPush, returnConfirm }
function pushZd(ids) {
return request({ url: base + '/pushZd', method: 'post', data: ids })
}
return { del, edit, get, outPush, returnConfirm, pushZd }
}