Browse Source

选择供应商可供物料选择条件加一个物料编码查询

采购订单页面增加批量下达功能
验货申请新增订单类型筛选条件
供应商价格管理新增字段属性:长,宽,高,毛重、净重
修改一个sku对应多个基准料号权限
master
qiankanghui 1 week ago
parent
commit
6f2f490dc6
  1. 2
      src/api/order/poOrder.js
  2. 178
      src/views/modules/inspection/inspectionRequestList.vue
  3. 16
      src/views/modules/inspection/mySampleInspectionList.vue
  4. 96
      src/views/modules/order/poOrder.vue
  5. 28
      src/views/modules/srmBaseInformation/srmPartSku.vue
  6. 52
      src/views/modules/srmPart/partInfoList.vue
  7. 116
      src/views/modules/supplier/supplierPartMoqPrice.vue

2
src/api/order/poOrder.js

@ -25,7 +25,7 @@ export const closePoDetail = (data) => createAPI(`/pODetail/closePoDetail`, 'pos
/** 打开 PO 订单行(已关闭 → 按验货数量恢复状态) */
export const openPoDetail = (data) => createAPI(`/pODetail/openPoDetail`, 'post', data)
/** 下达 PO 订单行(草稿 → 已下达) */
/** 下达 PO 订单行(草稿 → 已下达):单行与「一键下达」共用,支持批量;传单元素数组即为单行 */
export const issuePoDetail = (data) => createAPI(`/pODetail/issuePoDetail`, 'post', data)
/** 回滚 PO 订单行(已下达 → 草稿) */

178
src/views/modules/inspection/inspectionRequestList.vue

@ -3,6 +3,15 @@
<!-- 查询条件 -->
<el-form :inline="true" label-position="top" class="search-form-inline">
<div class="search-row">
<el-form-item label="订单类型" class="search-item">
<el-select v-model="searchData.orderType" placeholder="全部" style="width: 120px">
<el-option
v-for="item in poOrderTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item v-if="!isSupplierPageMode" class="search-item">
<span style="cursor: pointer" slot="label" @click="getBaseList(520)"><a href="#">供应商编码</a></span>
<el-input v-model="searchData.supplierNo" style="width: 120px" @keyup.enter.native="getMainData"/>
@ -311,58 +320,11 @@
<!-- 步骤2:批量选择PO / 编辑态PO明细 -->
<div class="po-section">
<div class="section-title">
<span>{{ isEditDialogMode ? 'PO明细' : '批量选择PO' }}</span>
<span>PO明细</span>
</div>
<!-- PO号筛选和排序工具栏 -->
<div v-if="!isEditDialogMode" class="po-toolbar">
<el-form :inline="true" label-width="70px" size="mini" class="add-po-search-form">
<el-form-item label="PO">
<el-input
v-model="addPoFilter.orderNo"
clearable
style="width: 120px"
@keyup.enter.native="filterAddPoList"/>
</el-form-item>
<el-form-item label="Item">
<el-input
v-model="addPoFilter.item"
clearable
style="width: 120px"
@keyup.enter.native="filterAddPoList"/>
</el-form-item>
<el-form-item label="D_CRD">
<div class="date-range">
<el-date-picker
v-model="addPoFilter.crdStart"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="from"
clearable
style="width: 110px"
@change="filterAddPoList"/>
<span class="split">to</span>
<el-date-picker
v-model="addPoFilter.crdEnd"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="to"
clearable
style="width: 110px"
@change="filterAddPoList"/>
</div>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" size="medium" style="margin-top:13px;" @click="filterAddPoList">查询</el-button>
<el-button type="primary" size="medium" style="margin-top:13px;" @click="filterAddPoList">查询</el-button>
</el-form-item>
</el-form>
</div>
<!-- 编辑态PO明细筛选工具栏 -->
<div v-if="isEditDialogMode" class="po-toolbar">
<!-- PO明细筛选工具栏(新增/编辑共用:查询 + 新增) -->
<div class="po-toolbar">
<el-form :inline="true" label-width="70px" size="mini" class="add-po-search-form">
<el-form-item label="PO">
<el-input
@ -409,71 +371,6 @@
</div>
<el-table
v-if="!isEditDialogMode"
key="create-po-table"
ref="addPoTable"
:data="filteredPoList"
border
size="small"
table-layout="fixed"
height="350px"
style="width: 100%; margin-top: -10px;"
@selection-change="handleSelectionChange">
<el-table-column v-if="!isEditDialogMode" type="selection" width="30" align="center" fixed="left" />
<el-table-column prop="orderRef2" label="PO行号" header-align="center" align="center" width="60"/>
<el-table-column prop="orderRef1" label="PO号" header-align="center" align="center" width="120"/>
<el-table-column prop="item" label="Item" header-align="center" align="left" min-width="100" show-overflow-tooltip/>
<el-table-column prop="qty" label="订单数量" header-align="center" align="right" width="80"/>
<el-table-column label="此次验货数量" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.inspectQty"
:min="0"
:max="scope.row.qty || 999999"
size="mini"
:controls="false"
style="width: 100%; box-sizing: border-box;">
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="shipMethod" label="运输方式" header-align="center" align="center" width="100">
<template slot-scope="scope">
<el-select v-model="scope.row.shipMethod" placeholder="请选择" size="mini" style="width: 100%; box-sizing: border-box;">
<el-option
v-for="opt in shipMethodOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="crd"
label="CRD"
header-align="center"
align="center"
width="160"
sortable
:sort-method="(a, b) => sortCrdDate(a, b)">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.crd"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"
size="mini"
style="width: 100%;"
/>
</template>
</el-table-column>
<el-table-column prop="eta" label="ETA" header-align="center" align="center" width="110"/>
<el-table-column prop="planner" label="Planner" header-align="center" align="left" min-width="120" show-overflow-tooltip/>
</el-table>
<el-table
v-else
key="edit-po-table"
:data="filteredEditPoDetailList"
border
@ -918,7 +815,7 @@
<el-dialog
title="选择PO明细"
:visible.sync="addPoDialogVisible"
width="80%"
width="60%"
append-to-body
:close-on-click-modal="false">
<!-- 选择PO明细筛选工具栏(与新增一致:PO、Item、D_CRD) -->
@ -979,15 +876,10 @@
style="width: 100%; margin-top: 12px;"
@selection-change="handleAddPoSelectionChange">
<el-table-column type="selection" width="40" align="center" fixed="left" />
<el-table-column prop="orderRef2" label="PO行号" header-align="center" align="center" width="60"/>
<el-table-column prop="orderRef1" label="PO号" header-align="center" align="center" width="120"/>
<el-table-column prop="orderRef2" label="PO行号" header-align="center" align="center" width="80"/>
<el-table-column prop="partNo" label="产品编码" header-align="center" align="left" min-width="120" show-overflow-tooltip/>
<el-table-column prop="item" label="Item" header-align="center" align="left" min-width="100" show-overflow-tooltip/>
<el-table-column prop="sku" label="SKU" header-align="center" align="left" min-width="120" show-overflow-tooltip/>
<el-table-column prop="partDesc" label="物料名称" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
<el-table-column prop="planner" label="Planner" header-align="center" align="left" min-width="120" show-overflow-tooltip/>
<el-table-column prop="qty" label="订单数量" header-align="center" align="right" width="90"/>
<el-table-column prop="waitInspectQty" label="未验货数量" header-align="center" align="right" width="90"/>
<el-table-column prop="qty" label="订单数量" header-align="center" align="right" width="80"/>
<el-table-column label="此次验货数量" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-input-number
@ -1000,7 +892,7 @@
</el-input-number>
</template>
</el-table-column>
<el-table-column label="运输方式" header-align="center" align="center" width="120">
<el-table-column label="运输方式" header-align="center" align="center" width="100">
<template slot-scope="scope">
<el-select v-model="scope.row.shipMethod" placeholder="请选择" size="mini" style="width: 100%;">
<el-option
@ -1012,7 +904,7 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="CRD日期" header-align="center" align="center" width="160">
<el-table-column label="CRD" header-align="center" align="center" width="160">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.crd"
@ -1021,10 +913,12 @@
format="yyyy-MM-dd"
placeholder="选择日期"
size="mini"
style="width: 80%;">
style="width: 100%;">
</el-date-picker>
</template>
</el-table-column>
<el-table-column prop="eta" label="ETA" header-align="center" align="center" width="110"/>
<el-table-column prop="planner" label="Planner" header-align="center" align="left" min-width="120" show-overflow-tooltip/>
</el-table>
</div>
<el-pagination
@ -1212,6 +1106,7 @@ import ComInspectionRequestFeeTab from './com_inspectionRequestFeeTab.vue'
import { fetchSupplierDetail } from '@/utils/supplierChooselistHelper'
import excel from '@/utils/excel-util.js'
import { listActiveShipMethods } from '@/api/port/portTransit.js'
import { PO_ORDER_TYPE_OPTIONS } from '@/views/modules/order/poOrderTypeOptions.js'
export default {
props: {
@ -1451,12 +1346,15 @@ export default {
uploadFileName: '',
uploadFile: null,
uploadPreviewList: [],
// 订单类型筛选选项(与订单页一致:采购订单 PO / 打样单 Sample) - rqrq
poOrderTypeOptions: PO_ORDER_TYPE_OPTIONS,
searchData: {
requestNo: '',
supplierNo: '',
supplierName: '',
planner: '',
status: '',
orderType: 'PO',
qcOperator: '',
createBy: '',
requestDateStart: '',
@ -2029,7 +1927,6 @@ export default {
this.$set(this.addFormData, 'inspectCityShort', '')
this.$set(this.addFormData, 'contact', '')
console.log('供应商编码赋值:', supplierNoVal, '供应商名称赋值:', supplierNameVal)
this.loadPoList()
// 查询供应商地址获取验货地址和联系人
if (supplierNoVal) {
this.fetchSupplierAddress(supplierNoVal)
@ -2193,12 +2090,12 @@ export default {
addInspectionRequest () {
this.addDialogMode = 'create'
this.resetAddForm()
this.editPoEditMode = true // 新增弹窗下半部分与编辑一致:明细可直接编辑
if (this.isSupplierPageMode) {
if (!this.applyCurrentSupplierToAddForm()) {
this.$message.warning('当前账号未维护供应商编码,请先在用户维护中配置')
return
}
this.loadPoList()
this.fetchSupplierAddress(this.addFormData.supplierNo)
}
this.addDialogVisible = true
@ -2512,8 +2409,8 @@ export default {
limit: this.addPoSelectPageSize
}
// 如果是编辑模式且已有PO明细,构建排除列表
if (this.isEditDialogMode && this.editPoDetailList && this.editPoDetailList.length > 0) {
// 如果已有PO明细,构建排除列表(新增/编辑均适用,避免重复选择)
if (this.editPoDetailList && this.editPoDetailList.length > 0) {
const excludePoItems = []
this.editPoDetailList.forEach(item => {
// 优先使用 poNo 和 poItemNo(对应后端 order_no 和 item_no)
@ -2640,7 +2537,7 @@ export default {
return
}
if (!this.addFormData.requestNo) {
if (this.isEditDialogMode && !this.addFormData.requestNo) {
this.$message.warning('申请单号为空,无法添加PO明细')
return
}
@ -3243,7 +3140,6 @@ export default {
this.addPoPlannerDisplayFromChooser = ''
this.poSupplierDialogVisible = false
this.orderSupplierDialogVisible = false
this.loadPoList()
this.fetchSupplierAddress(supplierNoVal)
},
@ -3635,19 +3531,19 @@ export default {
this.handleSaveEdit()
return
}
console.log('开始保存,当前选择的PO列表:', this.selectedPoList)
console.log('开始保存,当前PO明细列表:', this.editPoDetailList)
console.log('表单数据:', this.addFormData)
this.$refs.addFormData.validate((valid) => {
console.log('表单验证结果:', valid)
if (valid) {
if (this.selectedPoList.length === 0) {
this.$message.warning('请至少选择一条PO明细')
if (this.editPoDetailList.length === 0) {
this.$message.warning('请至少添加一条PO明细')
return
}
// 检查验货数量
const hasInvalidQty = this.selectedPoList.some(item => !item.inspectQty || item.inspectQty <= 0)
const hasInvalidQty = this.editPoDetailList.some(item => !item.qty || item.qty <= 0)
if (hasInvalidQty) {
this.$message.warning('请填写有效的验货数量')
return
@ -3664,14 +3560,14 @@ export default {
inspectContract: this.addFormData.contact,
inspectPhone: this.addFormData.inspectPhone || '',
remark: '',
items: this.selectedPoList.map(item => ({
orderNo: item.orderNo || item.order_ref1 || item.orderRef1,
itemNo: item.itemNo || item.item_no || item.order_ref2 || item.orderRef2,
items: this.editPoDetailList.map(item => ({
orderNo: item.poNo || item.orderNo || item.order_ref1 || item.orderRef1,
itemNo: item.poItemNo || item.itemNo || item.item_no || item.orderRef2 || item.order_ref2,
partNo: item.partNo,
orderRef1: item.orderRef1,
orderRef2: item.orderRef2,
qty: item.inspectQty,
shipMethod: item.shipMethod,
qty: item.qty,
shipMethod: item.shipMothod || item.shipMethod,
crd: item.crd
}))
}

16
src/views/modules/inspection/mySampleInspectionList.vue

@ -4,7 +4,7 @@
<el-form :inline="true" label-position="top" class="search-form-inline" @submit.native.prevent>
<div class="search-row">
<el-form-item class="search-item">
<span style="cursor: pointer" slot="label" @click="getBaseList(520)"><a href="#">供应商编码</a></span>
<span style="cursor: pointer" slot="label" @click="getBaseList(520)"><a href="#">供应商名称</a></span>
<el-input v-model="searchData.supplierName" clearable style="width: 300px" @keyup.enter.native="handleSearch"/>
</el-form-item>
<el-form-item label="计划开始日期" class="search-item">
@ -16,6 +16,12 @@
<el-form-item label="Item" class="search-item">
<el-input v-model="searchData.item" clearable style="width: 100px" @keyup.enter.native="handleSearch"/>
</el-form-item>
<el-form-item label="物料编码" class="search-item">
<el-input v-model="searchData.partNo" clearable style="width: 130px" @keyup.enter.native="handleSearch"/>
</el-form-item>
<el-form-item label="基准物料" class="search-item">
<el-input v-model="searchData.basePartNo" clearable style="width: 130px" @keyup.enter.native="handleSearch"/>
</el-form-item>
<el-form-item label=" " class="search-item search-btn-item">
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button type="primary" @click="handleReset" style="margin-left: 2px">重置</el-button>
@ -43,6 +49,8 @@
<el-table-column prop="inspectContract" label="联系人" header-align="center" align="center" width="100"/>
<el-table-column prop="orderRef1" label="PO号" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
<el-table-column prop="item" label="Item" header-align="center" align="left" min-width="120" show-overflow-tooltip/>
<el-table-column prop="partNo" label="物料编码" header-align="center" align="left" min-width="140" show-overflow-tooltip/>
<el-table-column prop="basePartNo" label="基准物料" header-align="center" align="left" min-width="140" show-overflow-tooltip/>
<el-table-column prop="qty" label="验货数量" header-align="center" align="right" width="120"/>
<el-table-column prop="approveQty" label="检验通过数量" header-align="center" align="right" width="120"/>
<el-table-column prop="status" label="状态" header-align="center" align="center" width="100">
@ -107,7 +115,9 @@ export default {
supplierName: '',
planStartDate: '',
orderRef1: '',
item: ''
item: '',
partNo: '',
basePartNo: ''
}
}
},
@ -153,6 +163,8 @@ export default {
this.searchData.planStartDate = ''
this.searchData.orderRef1 = ''
this.searchData.item = ''
this.searchData.partNo = ''
this.searchData.basePartNo = ''
this.pageIndex = 1
this.getList()
},

96
src/views/modules/order/poOrder.vue

@ -34,6 +34,7 @@
</el-button>
<el-button v-if="editMode" style="margin-left: 2px" @click="cancelEditMode">取消</el-button>
<el-button type="success" plain style="margin-left: 2px" @click="openSyncTransitCycleDialog" v-if="!editMode" :disabled="!syncSelection || !syncSelection.length">同步运输周期</el-button>
<el-button type="primary" plain style="margin-left: 2px" @click="handleBatchIssuePoOrder" v-if="!editMode" :disabled="!syncSelection || !syncSelection.length || batchIssuing">批量下达</el-button>
<el-button type="primary" style="margin-left: 2px" @click="openAddDialog" v-if="!editMode">新增</el-button>
<el-button type="primary" plain style="margin-left: 2px" @click="openCurrentRowPriceDialog" v-if="!editMode" :disabled="!currentRow">查看价格表</el-button>
<el-button type="warning" plain style="margin-left: 2px" @click="handleSplitToNewPo" v-if="!editMode" :disabled="!currentRow || !canSplitToNewPo(currentRow.status)">拆单到新PO</el-button>
@ -924,12 +925,19 @@
@closed="resetSupplierPartDialog">
<div style="margin-bottom: 10px; color: #606266;">
<span>供应商:{{ supplierPartDialogSupplierNo }}</span>
<el-input
v-model="supplierPartDialogPartNoFilter"
placeholder="物料编码(支持模糊)"
clearable
size="small"
style="width: 200px; margin-left: 16px; vertical-align: middle;"
@keyup.enter.native="loadSupplierPartOptions"></el-input>
<el-input
v-model="supplierPartDialogItemFilter"
placeholder="Item(支持模糊)"
clearable
size="small"
style="width: 200px; margin-left: 16px; vertical-align: middle;"
style="width: 200px; margin-left: 8px; vertical-align: middle;"
@keyup.enter.native="loadSupplierPartOptions"></el-input>
<el-button
type="primary"
@ -1219,6 +1227,8 @@ export default {
masterRows: [],
// 主页面「同步运输周期」勾选行
syncSelection: [],
// 「一键下达」批量处理中(防止重复点击)
batchIssuing: false,
// 同步运输周期弹窗
syncTransitCycleDialogVisible: false,
syncTransitCycleSaving: false,
@ -1289,6 +1299,7 @@ export default {
supplierPartDialogTargetRow: null,
supplierPartDialogSupplierNo: '',
supplierPartDialogSite: '',
supplierPartDialogPartNoFilter: '',
supplierPartDialogItemFilter: '',
// 供应商可供物料价格表弹窗状态
supplierPartPriceDialogVisible: false,
@ -3140,17 +3151,76 @@ export default {
const poLabel = row.poNo ? `PO ${row.poNo}` : '该订单'
const itemLabel = row.itemNo != null ? ` 行 ${row.itemNo}` : ''
this.$confirm(`确定下达${poLabel}${itemLabel}?`, '提示', { type: 'warning' }).then(() => {
issuePoDetail(params).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('下达成功')
this.getDataList()
// 单行下达与一键下达共用同一接口,传单元素数组
this.submitIssueRows([params], false)
}).catch(() => {})
},
// 一键下达:对勾选行中处于「草稿」状态的订单行批量下达(与单行下达共用同一接口,一次请求)
handleBatchIssuePoOrder () {
const selected = this.syncSelection || []
const draftRows = selected.filter(row => canIssuePoOrder(row.status))
if (!draftRows.length) {
this.$message.warning('勾选的行中没有可下达(草稿)的订单行')
return
}
const paramsList = draftRows
.map(row => buildPoDetailActionParams(row, this.$store.state.user.site))
.filter(params => params.id || (params.orderNo && params.site && params.itemNo != null))
if (!paramsList.length) {
this.$message.error('无法识别勾选的订单行,请刷新后重试')
return
}
const skipped = selected.length - draftRows.length
let tip = `确定一键下达勾选的 ${draftRows.length} 行草稿订单?`
if (skipped > 0) {
tip += `(另有 ${skipped} 行非草稿状态将跳过)`
}
this.$confirm(tip, '提示', { type: 'warning' }).then(() => {
this.submitIssueRows(paramsList, true)
}).catch(() => {})
},
/**
* 提交下达(单行/批量共用后端 /issuePoDetail,入参为数组):
* rows 为 [{id,orderNo,site,itemNo}] 数组,一次请求;后端逐行校验返回 summary(successCount/failCount/failDetails)。
* isBatch=true 按成功/失败汇总提示并清空勾选,否则按单行结果提示。
*/
submitIssueRows (rows, isBatch) {
this.batchIssuing = true
issuePoDetail(rows).then(({ data }) => {
if (data && data.code === 0) {
const s = (data.data && data.data.summary) || {}
const successCount = s.successCount || 0
const failDetails = s.failDetails || []
const failCount = s.failCount != null ? s.failCount : failDetails.length
if (!failCount) {
this.$message.success(isBatch ? `下达完成:成功 ${successCount} 行` : '下达成功')
} else if (isBatch) {
const reasonLines = failDetails.map(f => `${f.orderNo || ''} 行 ${f.itemNo != null ? f.itemNo : ''}:${f.reason || '下达失败'}`)
this.$message({
type: successCount ? 'warning' : 'error',
dangerouslyUseHTMLString: true,
message: `下达完成:成功 ${successCount} 行,失败 ${failCount} 行<br/>` + reasonLines.join('<br/>')
})
} else {
this.$message.error((data && data.msg) || '下达失败')
this.$message.error((failDetails[0] && failDetails[0].reason) || '下达失败')
}
}).catch(err => {
this.$message.error((err && err.message) || '下达失败')
})
}).catch(() => {})
if (isBatch) {
this.syncSelection = []
if (this.$refs.poTable && this.$refs.poTable.clearSelection) {
this.$refs.poTable.clearSelection()
}
}
this.getDataList()
} else {
this.$message.error((data && data.msg) || '下达失败')
}
}).catch(err => {
this.$message.error((err && err.message) || '下达失败')
}).finally(() => {
this.batchIssuing = false
})
},
// 回滚:已下达 → 草稿(下达的逆操作,已发生验货/发货动作的行后端会拦截)
@ -4955,6 +5025,7 @@ export default {
this.supplierPartDialogTargetRow = context === 'row' ? row : null
this.supplierPartDialogSupplierNo = supplierNo
this.supplierPartDialogSite = site
this.supplierPartDialogPartNoFilter = ''
this.supplierPartDialogItemFilter = ''
this.loadSupplierPartOptions()
},
@ -4970,6 +5041,7 @@ export default {
const supplierCode = String((context === 'row'
? ((this.supplierPartDialogTargetRow && (this.supplierPartDialogTargetRow.supplierNo || this.supplierPartDialogTargetRow.supplier_no || this.supplierPartDialogTargetRow.supplierCode || this.supplierPartDialogTargetRow.supplier_code)) || supplierNo)
: (context === 'addDetail' ? (this.addDetailForm.supplierNo || supplierNo) : (this.addForm.supplierNo || supplierNo))) || '').trim()
const partNo = (this.supplierPartDialogPartNoFilter || '').trim().toUpperCase()
const item = (this.supplierPartDialogItemFilter || '').trim().toUpperCase()
this.supplierPartDialogLoading = true
this.supplierPartDialogRows = []
@ -4977,6 +5049,7 @@ export default {
site,
supplierCode,
active: 'Y',
partNo,
item
}).then(({ data }) => {
if (data && data.code === 0) {
@ -4987,7 +5060,7 @@ export default {
sku: item.sku || ''
}))
if (this.supplierPartDialogRows.length === 0) {
this.$message.warning(item ? `未查到 Item 匹配 ${item} 的可供物料` : '该供应商未维护供应商可供物料')
this.$message.warning((partNo || item) ? `未查到匹配条件的可供物料` : '该供应商未维护供应商可供物料')
}
return
}
@ -5022,6 +5095,7 @@ export default {
this.supplierPartDialogTargetRow = null
this.supplierPartDialogSupplierNo = ''
this.supplierPartDialogSite = ''
this.supplierPartDialogPartNoFilter = ''
this.supplierPartDialogItemFilter = ''
},
// 打开供应商可供物料价格表弹窗:按当前供应商 + 行物料编码查当前生效阶梯价

28
src/views/modules/srmBaseInformation/srmPartSku.vue

@ -129,12 +129,6 @@
<el-input v-model="modalData.sku" :disabled="modalDisableFlag" placeholder="请输入SKU编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="基准料号" prop="basePartNo">
<el-input v-model="modalData.basePartNo" placeholder="请输入基准料号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
@ -199,7 +193,6 @@ export default {
deep: true,
handler: function () {
this.modalData.sku = (this.modalData.sku || '').toUpperCase()
this.modalData.basePartNo = (this.modalData.basePartNo || '').toUpperCase()
}
}
},
@ -243,7 +236,6 @@ export default {
sku: '',
remark: '',
active: 'Y',
basePartNo: '',
createBy: this.$store.state.user.name
},
@ -266,24 +258,6 @@ export default {
fixed: '',
columnWidth: 180
},
{
userId: this.$store.state.user.name,
functionId: functionId,
serialNumber: 'srmPartSkuTableBasePartNo',
tableId: 'srmPartSkuTable',
tableName: 'SKU管理表',
columnProp: 'basePartNo',
headerAlign: 'center',
align: 'left',
columnLabel: '基准料号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 180
},
{
userId: this.$store.state.user.name,
functionId: functionId,
@ -456,7 +430,6 @@ export default {
sku: '',
remark: '',
active: 'Y',
basePartNo: '',
createBy: this.$store.state.user.name
}
@ -478,7 +451,6 @@ export default {
sku: row.sku,
remark: row.remark || '',
active: row.active,
basePartNo: row.basePartNo || '',
createBy: this.$store.state.user.name
}

52
src/views/modules/srmPart/partInfoList.vue

@ -595,7 +595,7 @@ export default {
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: false
@ -649,7 +649,7 @@ export default {
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: false
@ -667,7 +667,7 @@ export default {
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: false
@ -905,8 +905,26 @@ export default {
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: 'partTableCreateDate',
tableId: 'partTable',
tableName: '产品信息',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnWidth: '150',
columnHidden: false,
columnImage: false,
columnSortable: true,
sortLv: 0,
status: true,
fixed: false
}
// {
// {
// userId: this.$store.state.user.name,
// functionId: this.functionId,
// serialNumber: 'partTableDepartmentName',
@ -1959,7 +1977,7 @@ export default {
})
},
// 冲突处理:基准料号已对应其他SKU时走“统一修改该基准料号下的SKU”;SKU 已被其他基准料号占用时仍人工维护拦截
// 冲突处理:基准料号已对应其他SKU时走“统一修改该基准料号下的SKU”;方向A(SKU 已被其他基准料号占用)已放开,不再拦截
promptSkuBasePartNoConflict (data, sku, skipNavigation, basePartNo) {
// 基准料号已对应其他SKU:本次目标就是把它们统一成新SKU,不存在占用风险,直接按统一修改处理
if (data.conflictType === 'BASE_PART_NO') {
@ -1982,29 +2000,11 @@ export default {
return false
})
}
const msg = `SKU ${sku} 已在 SKU 管理中维护基准料号 ${data.dbBasePartNo},与本次的基准料号不一致。`
if (skipNavigation) {
this.$message.error(`${msg}请先到 SKU 管理页手动维护后再指定。`)
return Promise.resolve(false)
}
this.$confirm(
`${msg}是否前往 SKU 管理页手动维护?前往后将不再保存本次新增。`,
'SKU与基准料号冲突',
{
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}
).then(() => {
if (this.isAdd) {
this.partDialogVisible = false
}
this.$router.push({ name: 'srmBaseInformation-srmPartSku', query: { sku } })
}).catch(() => {})
return Promise.resolve(false)
// 方向A 已放开:后端不再产生 conflictType='SKU',其余情况直接放行继续保存/指定 - rqrq
return Promise.resolve(true)
},
// 按基准料号统一修改SKU(后端同步维护 part_sku:新增新SKU并清除原SKU的基准料号),成功返回 true 继续保存
// 按基准料号统一修改SKU(后端按 part 表把该基准料号下所有物料 sku 统一),成功返回 true 继续保存
unifySkuByBasePartNo (sku, basePartNo) {
return updateSkuByBasePartNo({
site: this.$store.state.user.site,

116
src/views/modules/supplier/supplierPartMoqPrice.vue

@ -91,6 +91,11 @@
<el-table-column prop="qtyCarton" label="QTY/CARTON" min-width="120" header-align="center" align="right" :formatter="formatNumberCell" />
<el-table-column prop="remark" label="Remark" min-width="160" header-align="center" align="left" show-overflow-tooltip />
<el-table-column prop="latestChanges" label="latest changes" min-width="160" header-align="center" align="left" show-overflow-tooltip />
<el-table-column prop="length" label="Length/CM" min-width="110" header-align="center" align="right" :formatter="formatOptionalNumberCell" />
<el-table-column prop="width" label="Width/CM" min-width="110" header-align="center" align="right" :formatter="formatOptionalNumberCell" />
<el-table-column prop="height" label="Height/CM" min-width="110" header-align="center" align="right" :formatter="formatOptionalNumberCell" />
<el-table-column prop="grossWeight" label="GW/KG" min-width="100" header-align="center" align="right" :formatter="formatOptionalNumberCell" />
<el-table-column prop="netWeight" label="NW/KG" min-width="100" header-align="center" align="right" :formatter="formatOptionalNumberCell" />
<el-table-column prop="active" label="在用" min-width="80" header-align="center" align="center">
<template slot-scope="scope">
<span>{{ scope.row.active === 'Y' ? '是' : '否' }}</span>
@ -189,6 +194,35 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="Length/CM">
<el-input-number v-model="addForm.length" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="Width/CM">
<el-input-number v-model="addForm.width" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="Height/CM">
<el-input-number v-model="addForm.height" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="GW/KG">
<el-input-number v-model="addForm.grossWeight" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="NW/KG">
<el-input-number v-model="addForm.netWeight" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="是否在用">
@ -297,6 +331,7 @@
:visible.sync="tierDialogVisible"
width="1000px"
:close-on-click-modal="false"
class="tier-change-dialog"
v-drag
>
<el-form label-position="top" :model="tierForm">
@ -372,6 +407,35 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="Length/CM">
<el-input-number v-model="tierForm.length" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="Width/CM">
<el-input-number v-model="tierForm.width" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="Height/CM">
<el-input-number v-model="tierForm.height" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="GW/KG">
<el-input-number v-model="tierForm.grossWeight" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="NW/KG">
<el-input-number v-model="tierForm.netWeight" :min="0" :controls="false" placeholder="可空" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="Remark" class="optional-text" :style="calcTextareaFollowGapStyle(2)">
@ -433,7 +497,7 @@
<span>附件</span>
<el-button type="primary" class="customer-bun-min" @click="openAttachmentUploadDialog">上传附件</el-button>
</div>
<el-table :data="attachmentList" border stripe :height="180" v-loading="attachmentLoading" style="width: 100%">
<el-table :data="attachmentList" border stripe :max-height="180" v-loading="attachmentLoading" style="width: 100%">
<el-table-column prop="fileName" label="文件名" min-width="260" header-align="center" align="left" show-overflow-tooltip />
<el-table-column prop="createdBy" label="上传人" min-width="120" header-align="center" align="center" />
<el-table-column prop="createDate" label="上传时间" min-width="160" header-align="center" align="center" />
@ -565,7 +629,12 @@ export default {
qtyCarton: 0,
active: 'Y',
remark: '',
latestChanges: ''
latestChanges: '',
length: null,
width: null,
height: null,
grossWeight: null,
netWeight: null
},
copyDialogVisible: false,
copyDialogLoading: false,
@ -596,6 +665,11 @@ export default {
active: 'Y',
remark: '',
latestChanges: '',
length: null,
width: null,
height: null,
grossWeight: null,
netWeight: null,
tierPriceList: []
},
attachmentLoading: false,
@ -804,7 +878,12 @@ export default {
qtyCarton: 0,
active: 'Y',
remark: '',
latestChanges: ''
latestChanges: '',
length: null,
width: null,
height: null,
grossWeight: null,
netWeight: null
}
this.addDialogVisible = true
},
@ -830,7 +909,12 @@ export default {
qtyCarton: this.addForm.qtyCarton,
active: this.addForm.active || 'Y',
remark: this.addForm.remark || '',
latestChanges: this.addForm.latestChanges || ''
latestChanges: this.addForm.latestChanges || '',
length: this.addForm.length == null ? null : this.addForm.length,
width: this.addForm.width == null ? null : this.addForm.width,
height: this.addForm.height == null ? null : this.addForm.height,
grossWeight: this.addForm.grossWeight == null ? null : this.addForm.grossWeight,
netWeight: this.addForm.netWeight == null ? null : this.addForm.netWeight
}
addSupplierPartMoq(inData).then(({ data }) => {
if (data && data.code === 0) {
@ -976,6 +1060,12 @@ export default {
active: this.selectedSupplierPart.active || 'Y',
remark: this.selectedSupplierPart.remark || '',
latestChanges: this.selectedSupplierPart.latestChanges || '',
// 长宽高/毛净重可空,保留空值不回显为 0
length: this.selectedSupplierPart.length == null ? null : this.selectedSupplierPart.length,
width: this.selectedSupplierPart.width == null ? null : this.selectedSupplierPart.width,
height: this.selectedSupplierPart.height == null ? null : this.selectedSupplierPart.height,
grossWeight: this.selectedSupplierPart.grossWeight == null ? null : this.selectedSupplierPart.grossWeight,
netWeight: this.selectedSupplierPart.netWeight == null ? null : this.selectedSupplierPart.netWeight,
tierPriceList: (this.currentTierPriceList || []).map(item => ({
qtyStart: this.normalizeNumberValue(item.qtyStart, 0),
qtyEnd: this.normalizeNumberValue(item.qtyEnd, 0),
@ -1043,6 +1133,11 @@ export default {
formatNumberCell (row, column, cellValue) {
return String(this.normalizeNumberValue(cellValue, 0))
},
formatOptionalNumberCell (row, column, cellValue) {
// 可空数值字段:未填写时留白,避免误显示为 0
if (cellValue === null || cellValue === undefined || cellValue === '') return ''
return String(this.normalizeNumberValue(cellValue, 0))
},
formatPriceCell (row, column, cellValue) {
// 单价固定显示后四位小数
return this.normalizeNumberValue(cellValue, 0).toFixed(4)
@ -1122,7 +1217,12 @@ export default {
qtyCarton: this.tierForm.qtyCarton,
active: this.tierForm.active,
remark: this.tierForm.remark || '',
latestChanges: this.tierForm.latestChanges || ''
latestChanges: this.tierForm.latestChanges || '',
length: this.tierForm.length == null ? null : this.tierForm.length,
width: this.tierForm.width == null ? null : this.tierForm.width,
height: this.tierForm.height == null ? null : this.tierForm.height,
grossWeight: this.tierForm.grossWeight == null ? null : this.tierForm.grossWeight,
netWeight: this.tierForm.netWeight == null ? null : this.tierForm.netWeight
}
Promise.all([saveTierPrice(priceInData), saveSupplierPartMoq(moqInData)]).then(([priceRes, moqRes]) => {
const priceData = priceRes && priceRes.data
@ -1429,4 +1529,10 @@ export default {
line-height: 1.5;
}
/* 阶梯价格变更(维护MOQ)弹窗:内容不超时自适应,超过时弹窗内部滚动 */
.supplier-part-moq-price /deep/ .tier-change-dialog .el-dialog__body {
max-height: 560px;
overflow-y: auto;
}
</style>
Loading…
Cancel
Save