diff --git a/Antis.Erp.Plat/antis-ncc-admin/package.json b/Antis.Erp.Plat/antis-ncc-admin/package.json index 8f045f2..12f16fd 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/package.json +++ b/Antis.Erp.Plat/antis-ncc-admin/package.json @@ -7,7 +7,7 @@ "scripts": { "dev": "vue-cli-service serve --open", "dev:3000": "vue-cli-service serve --port 3000", - "build": "cross-env NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build", + "build": "cross-env NODE_ENV=production vue-cli-service build", "build:staging": "cross-env NODE_ENV=production vue-cli-service build --mode staging", "build:javaBootDev": "cross-env NODE_ENV=production vue-cli-service build --mode javaBootDev", "build:javaBootTest": "cross-env NODE_ENV=production vue-cli-service build --mode javaBootTest", diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtSp/index.vue b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtSp/index.vue index 1ff34cd..23df5a4 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtSp/index.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtSp/index.vue @@ -45,7 +45,7 @@ - + @@ -113,7 +113,7 @@ - + diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/Form.vue b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/Form.vue index 287c6ff..8c66b48 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/Form.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/Form.vue @@ -329,6 +329,7 @@ djlx:undefined, djzt: '', // 单据状态 cbje: undefined, // 主表出库成本合计(详情/已保存单据由后端返回) + ly: '后台', // 单据来源:后台录入为「后台」;收银台为「门店」,后台不可改 }, rules: { }, @@ -393,6 +394,12 @@ mounted() { }, methods: { + /** ERP 新建/保存销售出库单时固定为「后台」,避免与收银台「门店」混淆 */ + ensureBackendSalesSource() { + if (this.dataForm.djlx === '销售出库单') { + this.dataForm.ly = this.dataForm.ly || '后台' + } + }, // 获取商品信息(只通过API获取序列号类型) async getProductInfo(productId) { const key = String(productId); @@ -720,6 +727,8 @@ }) } else{ + _this.dataForm.ly = '后台'; + _this.dataForm.djlx = '销售出库单'; // 新建时加载默认选项设置 request({ url: '/api/Extend/WtMrsz', method: 'get' }).then(res => { if (res.data) { @@ -739,6 +748,7 @@ async saveDraft() { // 确保单据类型字段赋值 this.dataForm.djlx = '销售出库单'; + this.ensureBackendSalesSource(); this.$refs['elForm'].validate(async (valid) => { if (valid) { try { @@ -807,6 +817,7 @@ this.dataForm.djlx = '销售出库单'; // 确保单据状态为待审核 this.dataForm.djzt = '待审核'; + this.ensureBackendSalesSource(); // 检查是否有明细数据 if (!this.dataForm.wtXsckdMxList || this.dataForm.wtXsckdMxList.length === 0) { console.log('没有明细数据,跳过序列号验证'); @@ -916,6 +927,7 @@ if (valid) { console.log('表单验证通过,继续提交...'); try { + this.ensureBackendSalesSource(); // 格式化所有明细行的金额字段为 2 位小数 this.dataForm.wtXsckdMxList.forEach(row => { if (row.dj) { @@ -996,6 +1008,7 @@ if (valid) { console.log('表单验证通过,继续提交...'); try { + this.ensureBackendSalesSource(); if (!this.dataForm.id) { const res = await request({ url: `/api/Extend/WtXsckd`, @@ -1574,13 +1587,13 @@ }, getSpOptionLabel(item) { const base = ((item.spbm || '') + ' ' + (item.F_Spmc || '')).trim() - const c = this.productCostPreviewMap[item.F_Id] - if (c != null && c !== '' && !isNaN(parseFloat(c))) { - return base + ' (成本¥' + parseFloat(c).toFixed(2) + ')' - } - if (!this.costContextCk()) { - return base + ' (选仓库后显示成本)' - } + // const c = this.productCostPreviewMap[item.F_Id] + // if (c != null && c !== '' && !isNaN(parseFloat(c))) { + // return base + ' (成本¥' + parseFloat(c).toFixed(2) + ')' + // } + // if (!this.costContextCk()) { + // return base + ' (选仓库后显示成本)' + // } return base }, async loadProductCostPreviewMap() { diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/detail-view.vue b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/detail-view.vue new file mode 100644 index 0000000..364379f --- /dev/null +++ b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/detail-view.vue @@ -0,0 +1,579 @@ + + + + + diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/index.vue b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/index.vue index 5f4be17..a228ea3 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/index.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsckd/index.vue @@ -78,8 +78,9 @@ - - + + + @@ -138,20 +139,25 @@ + + + - + @@ -160,6 +166,7 @@ + @@ -167,10 +174,11 @@ import request from '@/utils/request' import { getDictionaryDataSelector } from '@/api/systemData/dictionary' import NCCForm from './Form' + import DetailView from './detail-view' import ExportBox from './ExportBox' import { previewDataInterface } from '@/api/systemData/dataInterface' export default { - components: { NCCForm, ExportBox }, + components: { NCCForm, DetailView, ExportBox }, data() { return { showAll: false, @@ -200,6 +208,7 @@ sidx: "", }, formVisible: false, + detailVisible: false, exportBoxVisible: false, columnList: [ { prop: 'id', label: '单据编号' }, @@ -228,6 +237,33 @@ this.getskzhOptions(); }, methods: { + /** 收银台/抖音等:不走 ERP 二级审核、仅查看 */ + isSkipErpAuditSource(row) { + if (!row) return false + const ly = row.ly + if (ly === '门店' || ly === '抖音订单' || ly === '抖音抓单') return true + const bz = row.bz != null && row.bz !== '' ? String(row.bz).trim() : '' + if (bz.startsWith('抖音订单:')) return true + return false + }, + /** 后台来源且草稿可编辑 */ + canEditDraft(row) { + return !this.isSkipErpAuditSource(row) && row.djzt === '草稿' + }, + canFirstApprove(row) { + if (this.isSkipErpAuditSource(row)) return false + if (row.djzt === '草稿' || row.djzt === '已审核') return false + return row.djzt === '待审核' || row.djzt === '' || row.djzt == null + }, + canSecondApprove(row) { + return !this.isSkipErpAuditSource(row) && row.djzt === '一级已审' + }, + formatLy(ly) { + if (ly == null || ly === '') return '无' + if (ly === '门店') return '门店(收银台)' + if (ly === '抖音订单') return '抖音订单' + return ly + }, // ✅ 原价:优先使用后端存储的 ydje(与收银台订单原价一致),无则用 收款+优惠 兼容旧数据 getDisplayOriginalPrice(row) { const ydje = row.ydje != null && row.ydje !== ''; @@ -392,10 +428,17 @@ }) }).catch(() => { }) }, - addOrUpdateHandle(id, isDetail) { + openDetail(id) { + if (!id) return + this.detailVisible = true + this.$nextTick(() => { + if (this.$refs.NCCDetailView) this.$refs.NCCDetailView.init(id) + }) + }, + addOrUpdateHandle(id) { this.formVisible = true this.$nextTick(() => { - this.$refs.NCCForm.init(id, isDetail) + this.$refs.NCCForm.init(id, false) }) }, exportData() { @@ -428,6 +471,7 @@ }, refresh(isrRefresh) { this.formVisible = false + this.detailVisible = false if (isrRefresh) this.reset() }, reset() { diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsthd/Form.vue b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsthd/Form.vue index 3570cbf..fd92a9f 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsthd/Form.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/views/wtXsthd/Form.vue @@ -1,7 +1,7 @@ -