diff --git a/src/api/srm/srmSupplier.js b/src/api/srm/srmSupplier.js index c1e532f..a66c81f 100644 --- a/src/api/srm/srmSupplier.js +++ b/src/api/srm/srmSupplier.js @@ -32,6 +32,12 @@ export const searchSrmMaterialFamilySupplierShare= (data) => createAPI(`/srmSupp export const saveSrmMaterialFamilySupplierShare= (data) => createAPI(`/srmSupplierShare/saveSrmMaterialFamilySupplierShare`,'post',data) export const deleteSrmMaterialFamilySupplierShareList= (data) => createAPI(`/srmSupplierShare/deleteSrmMaterialFamilySupplierShareList`,'post',data) +//------AVL 清单-------------- +export const searchAvlFamilyList = (data) => createAPI(`/srmSupplierShare/searchAvlFamilyList`, 'post', data) +export const searchAvlSupplierList = (data) => createAPI(`/srmSupplierShare/searchAvlSupplierList`, 'post', data) +export const searchAvlSupplierPartList = (data) => createAPI(`/srmSupplierShare/searchAvlSupplierPartList`, 'post', data) +export const searchAvlSupplierPartListPage = (data) => createAPI(`/srmSupplierShare/searchAvlSupplierPartListPage`, 'post', data) + //------payment proposal-------------- export const searchPaymentProposalList= (data) => createAPI(`/srmPaymentProposal/searchPaymentProposalList`,'post',data) export const createNewPaymentProposal= (data) => createAPI(`/srmPaymentProposal/createNewPaymentProposal`,'post',data) diff --git a/src/api/supplier/supplierPartMoqPrice.js b/src/api/supplier/supplierPartMoqPrice.js index 3a4b9ca..8de9ad0 100644 --- a/src/api/supplier/supplierPartMoqPrice.js +++ b/src/api/supplier/supplierPartMoqPrice.js @@ -9,6 +9,8 @@ export const addSupplierPartMoq = data => createAPI('/supplier/supplierPartMoqPr // 阶梯价接口 - rqrq export const listCurrentTierPrice = data => createAPI('/supplier/supplierPartMoqPrice/listCurrentTierPrice', 'post', data) export const saveTierPrice = data => createAPI('/supplier/supplierPartMoqPrice/saveTierPrice', 'post', data) +export const listCopySeriesPart = data => createAPI('/supplier/supplierPartMoqPrice/listCopySeriesPart', 'post', data) +export const copyTierPrice = data => createAPI('/supplier/supplierPartMoqPrice/copyTierPrice', 'post', data) export const uploadTierPricePreview = data => createAPI('/supplier/supplierPartMoqPrice/uploadPreview', 'post', data) export const uploadTierPriceConfirm = data => createAPI('/supplier/supplierPartMoqPrice/uploadConfirm', 'post', data) export const listTierPriceHistory = data => createAPI('/supplier/supplierPartMoqPrice/listTierPriceHistory', 'post', data) diff --git a/src/views/modules/order/poOrder.vue b/src/views/modules/order/poOrder.vue index 150fa6a..452d4b4 100644 --- a/src/views/modules/order/poOrder.vue +++ b/src/views/modules/order/poOrder.vue @@ -464,6 +464,8 @@ const ADD_TEXTAREA_FIELD_CODES = new Set(['remark']) const ADD_FULL_ROW_FIELD_CODES = new Set(['remark']) const ADD_NUMBER_FIELD_CODES = new Set(['price', 'qty', 'ship_qty', 'sum_price']) const ADD_FILTERABLE_SELECT_FIELD_CODES = new Set(['customer', 'buyer']) +const ADD_READONLY_DEFAULT_TODAY_FIELD_CODES = new Set(['order_date', 'create_date']) +const ADD_EDITABLE_DEFAULT_TODAY_FIELD_CODES = new Set(['po_place_date']) const ADD_SELECT_OPTIONS_FIELD_CODE_MAP = { order_type: 'poOrderTypeOptions', customer: 'poCustomerOptions', @@ -1832,6 +1834,9 @@ export default { if (code === 'customer') { return true } + if (ADD_READONLY_DEFAULT_TODAY_FIELD_CODES.has(code)) { + return true + } if (ADD_DISPLAY_ONLY_FIELD_CODES.has(code)) { return true } @@ -3057,6 +3062,7 @@ export default { }).then(({ data }) => { if (data && data.code === 0 && data.data) { this.addFormSchemaFields = data.data.fields || [] + this.applyAddDefaultDateBySchema() } else { this.addFormSchemaFields = [] } @@ -3065,6 +3071,32 @@ export default { }) }, + getTodayDateYmd () { + if (this.dayjs) { + return this.dayjs().format('YYYY-MM-DD') + } + const now = new Date() + const pad = (num) => String(num).padStart(2, '0') + return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}` + }, + + applyAddDefaultDateBySchema () { + if (!Array.isArray(this.addFormSchemaFields) || !this.addFormSchemaFields.length) { + return + } + const today = this.getTodayDateYmd() + this.addFormSchemaFields.forEach(field => { + const code = this.getAddFieldCode(field) + const prop = this.getAddFieldProp(field) + if (!code || !prop) { + return + } + if (ADD_READONLY_DEFAULT_TODAY_FIELD_CODES.has(code) || ADD_EDITABLE_DEFAULT_TODAY_FIELD_CODES.has(code)) { + this.$set(this.addForm, prop, today) + } + }) + }, + getAddExtValue (fieldCode) { if (!this.addForm.extValues) { return '' @@ -3080,6 +3112,7 @@ export default { }, createEmptyAddForm (orderType = '采购订单') { + const today = this.getTodayDateYmd() return { customer: '', buyer: '', @@ -3102,7 +3135,7 @@ export default { departure: '', destination: '', shipVia: '', - orderDate: '', + orderDate: today, enquiry: '', status: '草稿', confirmed: '', @@ -3111,7 +3144,7 @@ export default { crd: '', inspection: '', realCrd: '', - poPlaceDate: '', + poPlaceDate: today, poPromiseReadyDate: '', poActualReadyDate: '', chinaOfficeInspectionDate: '', diff --git a/src/views/modules/srmSupplier/supplierAvlList.vue b/src/views/modules/srmSupplier/supplierAvlList.vue new file mode 100644 index 0000000..651aeb3 --- /dev/null +++ b/src/views/modules/srmSupplier/supplierAvlList.vue @@ -0,0 +1,288 @@ + + + + + diff --git a/src/views/modules/supplier/supplierPartMoqPrice.vue b/src/views/modules/supplier/supplierPartMoqPrice.vue index 5d428c5..d053330 100644 --- a/src/views/modules/supplier/supplierPartMoqPrice.vue +++ b/src/views/modules/supplier/supplierPartMoqPrice.vue @@ -62,6 +62,7 @@ >查询 重置 新增 + 复制 @@ -237,6 +238,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + if (data && data.code === 0) { + this.copyPartRows = data.rows || [] + this.copyDialogVisible = true + this.$nextTick(() => { + // 每次打开清空多选,避免沿用上次选择 - rqrq + if (this.$refs.copyPartTable && this.$refs.copyPartTable.clearSelection) { + this.$refs.copyPartTable.clearSelection() + } + }) + return + } + this.copyPartRows = [] + this.$message.error((data && data.msg) || '加载同系列物料失败') + }).catch(err => { + this.copyPartRows = [] + this.$message.error((err && err.message) || '加载同系列物料失败') + }).finally(() => { + this.copyDialogLoading = false + }) + }, + isCopyRowSelectable (row) { + return !!(row && row.partNo && row.partNo !== this.copyForm.sourcePartNo) + }, + onCopySelectionChange (rows) { + this.copySelectionRows = rows || [] + }, + saveCopyTierPrice () { + const targetPartNos = (this.copySelectionRows || []) + .map(row => row.partNo) + .filter(partNo => partNo && partNo !== this.copyForm.sourcePartNo) + if (targetPartNos.length === 0) { + this.$message.warning('请至少选择一个目标物料') + return + } + this.copySaveLoading = true + copyTierPrice({ + site: this.$store.state.user.site, + supplierCode: this.copyForm.supplierCode, + sourcePartNo: this.copyForm.sourcePartNo, + targetPartNos, + submitBy: this.$store.state.user.name + }).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('复制成功') + this.copyDialogVisible = false + return + } + this.$message.error((data && data.msg) || '复制失败') + }).catch(err => { + this.$message.error((err && err.message) || '复制失败') + }).finally(() => { + this.copySaveLoading = false + }) + }, openTierDialog () { if (!this.selectedSupplierPart) { this.$message.warning('请先选择供应商物料')