-
+
+ 供应商ID
-
+
+
+
@@ -181,6 +188,7 @@ import {
} from "@/api/srm/srmSupplier.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import SysDictSelect from '@/components/dict/SysDictSelect.vue'
+import { selectDictDataList } from '@/api/dict'
import dayjs from "dayjs";
export default {
@@ -200,11 +208,13 @@ export default {
searchData: {
supplierId: '',
site: this.$store.state.user.site || this.$store.state.user.currentSite || '',
- addressType: '',
+ addressTypes: [],
active: '',
page: 1,
limit: 10,
},
+ // 地址类型字典(address_type)选项,供顶部多选筛选使用
+ addressTypeOptions: [],
height: 200,
pageIndex: 1,
pageSize: 20,
@@ -527,6 +537,8 @@ export default {
created () {
// 按钮控制
this.getButtonAuthData()
+ // 加载地址类型字典选项,供多选筛选使用
+ this.loadAddressTypeOptions()
// 默认查询当前工厂 - rqrq
this.searchData.site = (this.searchData.site || this.$store.state.user.site || this.$store.state.user.currentSite || '').trim()
// 无论是否有查询权限,都获取数据列表
@@ -534,6 +546,24 @@ export default {
},
methods: {
+ // 加载 address_type 字典项(仅 status=Y)
+ loadAddressTypeOptions () {
+ const site = (this.$store.state.user.site || this.$store.state.user.currentSite || '').trim()
+ selectDictDataList({
+ site,
+ dictType: 'address_type',
+ dictTypeList: [],
+ status: 'Y'
+ }).then(({ data }) => {
+ if (data && data.code === 0) {
+ this.addressTypeOptions = data.rows || []
+ } else {
+ this.addressTypeOptions = []
+ }
+ }).catch(() => {
+ this.addressTypeOptions = []
+ })
+ },
validateField(rule, value, callback) {
if (!value || value.trim() === '') {
callback(new Error());
@@ -783,9 +813,14 @@ export default {
let strVal = ''
let conSql = ''
if (val === 520) {
- strVal = this.modalData.supplierId || ''
- const currentSite = (this.modalData.site || this.searchData.site || this.$store.state.user.site || this.$store.state.user.currentSite || '').trim()
- conSql = " and site = '" + currentSite + "'"
+ if (targetField === 'searchSupplierId') {
+ // 顶部筛选:与 supplierList 供应商编码一致,只传 strVal,site 过滤交给 Chooselist 按登录 site 自动处理
+ strVal = this.searchData.supplierId || ''
+ } else {
+ strVal = this.modalData.supplierId || ''
+ const currentSite = (this.modalData.site || this.searchData.site || this.$store.state.user.site || this.$store.state.user.currentSite || '').trim()
+ conSql = " and site = '" + currentSite + "'"
+ }
}
this.$refs.baseList.init(val, strVal, conSql)
})
@@ -830,6 +865,11 @@ export default {
// 快捷查询回调
getBaseData (val) {
+ if (this.tagNo === 520 && this.targetField === 'searchSupplierId') {
+ // 回填顶部筛选的供应商ID
+ this.searchData.supplierId = val.supplier_no || ''
+ return
+ }
if (this.tagNo === 520 && this.targetField === 'supplierId') {
const supplierNoVal = val.supplier_no || ''
this.modalData.supplierId = supplierNoVal
diff --git a/src/views/modules/supplier/supplierPartNewProductAudit.vue b/src/views/modules/supplier/supplierPartNewProductAudit.vue
index 54de8ed..39d1792 100644
--- a/src/views/modules/supplier/supplierPartNewProductAudit.vue
+++ b/src/views/modules/supplier/supplierPartNewProductAudit.vue
@@ -91,14 +91,14 @@
@click="searchSupplierPartList"
>查询
重置
-
+
批量开始审核
+ >批量审核
@@ -115,7 +115,7 @@
@row-click="handleMainRowClick"
@selection-change="handleMainSelectionChange"
>
-
+
this.canRowStartAudit(r))
+ // 对「未发起」行执行开始审核,对「不通过」行执行重新审核 - rqrq
+ const rows = (this.mainSelection || []).filter(r => this.canRowBatchAudit(r))
if (rows.length === 0) {
- this.$message.warning('请勾选需要开始审核的物料(仅“未发起”状态可开始)')
+ this.$message.warning('请勾选需要操作的物料(仅"未发起"或"不通过"状态可批量操作)')
return
}
- this.$confirm(`确认对选中的 ${rows.length} 条物料批量开始审核?`, '批量开始审核', {
+ const startCount = rows.filter(r => this.canRowStartAudit(r)).length
+ const restartCount = rows.length - startCount
+ let confirmMsg = ''
+ if (startCount > 0 && restartCount > 0) {
+ confirmMsg = `确认对选中的 ${rows.length} 条物料批量操作?(开始审核 ${startCount} 条,重新审核 ${restartCount} 条)`
+ } else if (restartCount > 0) {
+ confirmMsg = `确认对选中的 ${rows.length} 条物料批量重新审核?`
+ } else {
+ confirmMsg = `确认对选中的 ${rows.length} 条物料批量开始审核?`
+ }
+ this.$confirm(confirmMsg, '批量操作', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -903,7 +918,7 @@ export default {
this.mainSelection = []
this.searchSupplierPartList()
if (failDetails.length === 0) {
- this.$message.success(`批量开始审核完成,成功 ${successCount} 条`)
+ this.$message.success(`批量操作完成,成功 ${successCount} 条`)
} else {
const detailMsg = failDetails.slice(0, 5).map(d => `${d.partNo}:${d.reason}`).join(';')
this.$message({
@@ -914,18 +929,19 @@ export default {
return
}
const row = rows[idx]
- startNewProductAudit({
- site: row.site,
- supplierCode: row.supplierCode,
- partNo: row.partNo
- }).then(({ data }) => {
+ const isRestart = !this.canRowStartAudit(row)
+ const apiCall = isRestart
+ ? restartNewProductAudit({ site: row.site, supplierCode: row.supplierCode, partNo: row.partNo })
+ : startNewProductAudit({ site: row.site, supplierCode: row.supplierCode, partNo: row.partNo })
+ const failMsg = isRestart ? '重新审核失败' : '开始审核失败'
+ apiCall.then(({ data }) => {
if (data && data.code === 0) {
successCount++
} else {
- failDetails.push({ partNo: row.partNo, reason: (data && data.msg) || '开始审核失败' })
+ failDetails.push({ partNo: row.partNo, reason: (data && data.msg) || failMsg })
}
}).catch(() => {
- failDetails.push({ partNo: row.partNo, reason: '开始审核失败' })
+ failDetails.push({ partNo: row.partNo, reason: failMsg })
}).finally(() => {
runNext(idx + 1)
})