Browse Source

新品流程OK

master
常熟吴彦祖 2 weeks ago
parent
commit
f58d19efe1
  1. 6
      src/api/srm/srmSupplier.js
  2. 2
      src/api/supplier/supplierPartMoqPrice.js
  3. 37
      src/views/modules/order/poOrder.vue
  4. 288
      src/views/modules/srmSupplier/supplierAvlList.vue
  5. 147
      src/views/modules/supplier/supplierPartMoqPrice.vue

6
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 saveSrmMaterialFamilySupplierShare= (data) => createAPI(`/srmSupplierShare/saveSrmMaterialFamilySupplierShare`,'post',data)
export const deleteSrmMaterialFamilySupplierShareList= (data) => createAPI(`/srmSupplierShare/deleteSrmMaterialFamilySupplierShareList`,'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-------------- //------payment proposal--------------
export const searchPaymentProposalList= (data) => createAPI(`/srmPaymentProposal/searchPaymentProposalList`,'post',data) export const searchPaymentProposalList= (data) => createAPI(`/srmPaymentProposal/searchPaymentProposalList`,'post',data)
export const createNewPaymentProposal= (data) => createAPI(`/srmPaymentProposal/createNewPaymentProposal`,'post',data) export const createNewPaymentProposal= (data) => createAPI(`/srmPaymentProposal/createNewPaymentProposal`,'post',data)

2
src/api/supplier/supplierPartMoqPrice.js

@ -9,6 +9,8 @@ export const addSupplierPartMoq = data => createAPI('/supplier/supplierPartMoqPr
// 阶梯价接口 - rqrq // 阶梯价接口 - rqrq
export const listCurrentTierPrice = data => createAPI('/supplier/supplierPartMoqPrice/listCurrentTierPrice', 'post', data) export const listCurrentTierPrice = data => createAPI('/supplier/supplierPartMoqPrice/listCurrentTierPrice', 'post', data)
export const saveTierPrice = data => createAPI('/supplier/supplierPartMoqPrice/saveTierPrice', '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 uploadTierPricePreview = data => createAPI('/supplier/supplierPartMoqPrice/uploadPreview', 'post', data)
export const uploadTierPriceConfirm = data => createAPI('/supplier/supplierPartMoqPrice/uploadConfirm', 'post', data) export const uploadTierPriceConfirm = data => createAPI('/supplier/supplierPartMoqPrice/uploadConfirm', 'post', data)
export const listTierPriceHistory = data => createAPI('/supplier/supplierPartMoqPrice/listTierPriceHistory', 'post', data) export const listTierPriceHistory = data => createAPI('/supplier/supplierPartMoqPrice/listTierPriceHistory', 'post', data)

37
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_FULL_ROW_FIELD_CODES = new Set(['remark'])
const ADD_NUMBER_FIELD_CODES = new Set(['price', 'qty', 'ship_qty', 'sum_price']) 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_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 = { const ADD_SELECT_OPTIONS_FIELD_CODE_MAP = {
order_type: 'poOrderTypeOptions', order_type: 'poOrderTypeOptions',
customer: 'poCustomerOptions', customer: 'poCustomerOptions',
@ -1832,6 +1834,9 @@ export default {
if (code === 'customer') { if (code === 'customer') {
return true return true
} }
if (ADD_READONLY_DEFAULT_TODAY_FIELD_CODES.has(code)) {
return true
}
if (ADD_DISPLAY_ONLY_FIELD_CODES.has(code)) { if (ADD_DISPLAY_ONLY_FIELD_CODES.has(code)) {
return true return true
} }
@ -3057,6 +3062,7 @@ export default {
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0 && data.data) { if (data && data.code === 0 && data.data) {
this.addFormSchemaFields = data.data.fields || [] this.addFormSchemaFields = data.data.fields || []
this.applyAddDefaultDateBySchema()
} else { } else {
this.addFormSchemaFields = [] 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) { getAddExtValue (fieldCode) {
if (!this.addForm.extValues) { if (!this.addForm.extValues) {
return '' return ''
@ -3080,6 +3112,7 @@ export default {
}, },
createEmptyAddForm (orderType = '采购订单') { createEmptyAddForm (orderType = '采购订单') {
const today = this.getTodayDateYmd()
return { return {
customer: '', customer: '',
buyer: '', buyer: '',
@ -3102,7 +3135,7 @@ export default {
departure: '', departure: '',
destination: '', destination: '',
shipVia: '', shipVia: '',
orderDate: '',
orderDate: today,
enquiry: '', enquiry: '',
status: '草稿', status: '草稿',
confirmed: '', confirmed: '',
@ -3111,7 +3144,7 @@ export default {
crd: '', crd: '',
inspection: '', inspection: '',
realCrd: '', realCrd: '',
poPlaceDate: '',
poPlaceDate: today,
poPromiseReadyDate: '', poPromiseReadyDate: '',
poActualReadyDate: '', poActualReadyDate: '',
chinaOfficeInspectionDate: '', chinaOfficeInspectionDate: '',

288
src/views/modules/srmSupplier/supplierAvlList.vue

@ -0,0 +1,288 @@
<template>
<div ref="pageRoot" class="customer-css">
<el-form :inline="true" label-position="top" style="margin-top: 0;">
<el-form-item label="物料分类名称:">
<el-input v-model="searchData.familyName" clearable style="width: 160px" />
</el-form-item>
<el-form-item label="分类级别:">
<el-select v-model="searchData.familyType" style="width: 120px">
<el-option v-for="item in familyLevelOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getFamilyList">查询</el-button>
</el-form-item>
</el-form>
<el-table
ref="familyTable"
:height="topHeight"
:data="familyRows"
border
highlight-current-row
v-loading="familyLoading"
style="width: 100%"
@row-click="onFamilyRowClick">
<el-table-column prop="familyId" label="物料分类编码" header-align="center" align="left" min-width="160" />
<el-table-column prop="familyName" label="物料分类名称" header-align="center" align="left" min-width="220" />
<el-table-column label="分类级别" header-align="center" align="center" min-width="110">
<template slot-scope="scope">
<span>{{ formatFamilyType(scope.row.familyType) }}</span>
</template>
</el-table-column>
</el-table>
<el-table
:height="bottomHeight"
:data="supplierRows"
border
v-loading="supplierLoading"
style="margin-top: 8px; width: 100%">
<el-table-column prop="supplierNo" label="供应商编码" header-align="center" align="left" min-width="160" />
<el-table-column prop="supplierName" label="供应商名称" header-align="center" align="left" min-width="260" />
<el-table-column label="操作" fixed="right" header-align="center" align="center" width="140">
<template slot-scope="scope">
<el-link type="primary" @click="openPartDialog(scope.row)">查看可供物料</el-link>
</template>
</el-table-column>
</el-table>
<el-dialog
title="可供物料"
:visible.sync="partDialogVisible"
width="960px"
top="4vh"
append-to-body
:close-on-click-modal="false"
v-drag>
<el-table
:data="partRows"
:height="430"
border
v-loading="partDialogLoading"
style="width: 100%">
<el-table-column prop="partNo" label="产品编码" header-align="center" align="left" min-width="170" />
<el-table-column prop="partDesc" label="产品名称" header-align="center" align="left" min-width="260" />
<el-table-column prop="basePartNo" label="基准料号" header-align="center" align="left" min-width="150" />
<el-table-column prop="sku" label="SKU" header-align="center" align="left" min-width="120" />
<el-table-column prop="item" label="Item" header-align="center" align="left" min-width="120" />
</el-table>
<el-pagination
style="margin-top: 8px; text-align: right"
@size-change="onPartPageSizeChange"
@current-change="onPartPageCurrentChange"
:current-page="partPageIndex"
:page-sizes="[20, 50, 100, 200]"
:page-size="partPageSize"
:total="partTotal"
layout="total, sizes, prev, pager, next, jumper"
/>
<div slot="footer" class="dialog-footer">
<el-button @click="partDialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
searchAvlFamilyList,
searchAvlSupplierList,
searchAvlSupplierPartListPage
} from '@/api/srm/srmSupplier'
export default {
data () {
return {
topHeight: 280,
bottomHeight: 280,
familyLoading: false,
supplierLoading: false,
partDialogLoading: false,
searchData: {
site: this.$store.state.user.site,
familyName: '',
familyType: 'level1'
},
familyLevelOptions: [
{ label: '一级', value: 'level1' },
{ label: '二级', value: 'level2' },
{ label: '三级', value: 'level3' }
],
familyRows: [],
currentFamilyRow: null,
supplierRows: [],
partDialogVisible: false,
partRows: [],
partPageIndex: 1,
partPageSize: 20,
partTotal: 0,
partDialogSupplierNo: ''
}
},
created () {
this.getFamilyList()
},
mounted () {
this.handleResize()
window.addEventListener('resize', this.handleResize)
},
beforeDestroy () {
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize () {
this.$nextTick(() => {
const rootEl = this.$refs.pageRoot || this.$el
if (!rootEl) {
return
}
const rootTop = rootEl.getBoundingClientRect().top
const viewportBottomGap = 24
const available = window.innerHeight - rootTop - viewportBottomGap
const nextTop = Math.max(220, Math.floor(available * 0.43))
const nextBottom = Math.max(220, available - nextTop - 74)
this.topHeight = nextTop
this.bottomHeight = nextBottom
})
},
formatFamilyType (familyType) {
if (familyType === 'level2') return '二级'
if (familyType === 'level3') return '三级'
return '一级'
},
getFamilyList () {
const site = (this.searchData.site || this.$store.state.user.site || '').trim()
if (!site) {
this.$message.warning('请先选择site')
return
}
this.familyLoading = true
searchAvlFamilyList({
site,
familyName: this.searchData.familyName,
familyType: this.searchData.familyType
}).then(({ data }) => {
if (data && data.code === 0) {
this.familyRows = data.rows || []
if (this.familyRows.length > 0) {
this.currentFamilyRow = this.familyRows[0]
this.$nextTick(() => {
if (this.$refs.familyTable && this.$refs.familyTable.setCurrentRow) {
this.$refs.familyTable.setCurrentRow(this.familyRows[0])
}
})
this.loadSupplierList()
} else {
this.currentFamilyRow = null
this.supplierRows = []
}
return
}
this.familyRows = []
this.currentFamilyRow = null
this.supplierRows = []
this.$message.error((data && data.msg) || '查询物料分类失败')
}).catch(() => {
this.familyRows = []
this.currentFamilyRow = null
this.supplierRows = []
this.$message.error('查询物料分类失败')
}).finally(() => {
this.familyLoading = false
})
},
onFamilyRowClick (row) {
this.currentFamilyRow = row || null
this.loadSupplierList()
},
loadSupplierList () {
if (!this.currentFamilyRow || !this.currentFamilyRow.familyId) {
this.supplierRows = []
return
}
this.supplierLoading = true
searchAvlSupplierList({
site: this.searchData.site,
familyType: this.currentFamilyRow.familyType || this.searchData.familyType,
familyId: this.currentFamilyRow.familyId
}).then(({ data }) => {
if (data && data.code === 0) {
this.supplierRows = data.rows || []
return
}
this.supplierRows = []
this.$message.error((data && data.msg) || '查询供应商清单失败')
}).catch(() => {
this.supplierRows = []
this.$message.error('查询供应商清单失败')
}).finally(() => {
this.supplierLoading = false
})
},
openPartDialog (row) {
if (!row || !row.supplierNo) {
this.$message.warning('请选择供应商')
return
}
if (!this.currentFamilyRow || !this.currentFamilyRow.familyId) {
this.$message.warning('请先选择物料分类')
return
}
this.partDialogSupplierNo = row.supplierNo
this.partPageIndex = 1
this.partDialogVisible = true
this.loadPartPage()
},
loadPartPage () {
if (!this.partDialogSupplierNo || !this.currentFamilyRow || !this.currentFamilyRow.familyId) {
this.partRows = []
this.partTotal = 0
return
}
this.partDialogLoading = true
searchAvlSupplierPartListPage({
site: this.searchData.site,
familyType: this.currentFamilyRow.familyType || this.searchData.familyType,
familyId: this.currentFamilyRow.familyId,
supplierNo: this.partDialogSupplierNo,
page: this.partPageIndex,
limit: this.partPageSize
}).then(({ data }) => {
if (data && data.code === 0) {
const pageData = data.page || {}
this.partRows = Array.isArray(pageData.list) ? pageData.list : []
this.partPageIndex = Number(pageData.currPage || this.partPageIndex || 1)
this.partPageSize = Number(pageData.pageSize || this.partPageSize || 20)
this.partTotal = Number(pageData.totalCount || 0)
return
}
this.partRows = []
this.partTotal = 0
this.$message.error((data && data.msg) || '查询可供物料失败')
}).catch(() => {
this.partRows = []
this.partTotal = 0
this.$message.error('查询可供物料失败')
}).finally(() => {
this.partDialogLoading = false
})
},
onPartPageSizeChange (val) {
this.partPageSize = Number(val) || 20
this.partPageIndex = 1
this.loadPartPage()
},
onPartPageCurrentChange (val) {
this.partPageIndex = Number(val) || 1
this.loadPartPage()
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-table__fixed-right-patch {
display: none !important;
}
</style>

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

@ -62,6 +62,7 @@
>查询</el-button> >查询</el-button>
<el-button class="customer-bun-min" @click="resetSearch">重置</el-button> <el-button class="customer-bun-min" @click="resetSearch">重置</el-button>
<el-button type="primary" class="customer-bun-min" @click="openAddDialog">新增</el-button> <el-button type="primary" class="customer-bun-min" @click="openAddDialog">新增</el-button>
<el-button type="primary" class="customer-bun-min" @click="openCopyDialog">复制</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -237,6 +238,62 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog
title="复制价格表"
:visible.sync="copyDialogVisible"
width="920px"
:close-on-click-modal="false"
v-drag
>
<el-form label-position="top" :model="copyForm">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="供应商编号">
<el-input v-model="copyForm.supplierCode" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="当前物料编码">
<el-input v-model="copyForm.sourcePartNo" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="基准料号">
<el-input v-model="copyForm.basePartNo" disabled />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
ref="copyPartTable"
:data="copyPartRows"
:height="360"
border
stripe
v-loading="copyDialogLoading"
@selection-change="onCopySelectionChange"
style="width: 100%"
>
<el-table-column
type="selection"
width="50"
header-align="center"
align="center"
:selectable="isCopyRowSelectable"
/>
<el-table-column prop="partNo" label="产品编码" min-width="180" header-align="center" align="left" />
<el-table-column prop="partDesc" label="物料名称" min-width="260" header-align="center" align="left" show-overflow-tooltip />
<el-table-column prop="item" label="Item" min-width="140" header-align="center" align="left" show-overflow-tooltip />
<el-table-column prop="sku" label="SKU" min-width="140" header-align="center" align="left" show-overflow-tooltip />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :disabled="copySaveLoading" @click="saveCopyTierPrice">
{{ copySaveLoading ? '保存中...' : '保存' }}
</el-button>
<el-button :disabled="copySaveLoading" @click="copyDialogVisible = false">取消</el-button>
</div>
</el-dialog>
<el-dialog <el-dialog
title="阶梯价格变更" title="阶梯价格变更"
:visible.sync="tierDialogVisible" :visible.sync="tierDialogVisible"
@ -400,6 +457,8 @@ import {
addSupplierPartMoq, addSupplierPartMoq,
listCurrentTierPrice, listCurrentTierPrice,
saveTierPrice, saveTierPrice,
listCopySeriesPart,
copyTierPrice,
uploadTierPricePreview uploadTierPricePreview
} from '@/api/supplier/supplierPartMoqPrice' } from '@/api/supplier/supplierPartMoqPrice'
import { import {
@ -458,6 +517,17 @@ export default {
moq: 0, moq: 0,
active: 'Y' active: 'Y'
}, },
copyDialogVisible: false,
copyDialogLoading: false,
copySaveLoading: false,
copyPartRows: [],
copySelectionRows: [],
copyForm: {
site: '',
supplierCode: '',
sourcePartNo: '',
basePartNo: ''
},
tierDialogVisible: false, tierDialogVisible: false,
tierSaveLoading: false, tierSaveLoading: false,
tierUploadLoading: false, tierUploadLoading: false,
@ -749,6 +819,83 @@ export default {
this.addSaveLoading = false this.addSaveLoading = false
}) })
}, },
openCopyDialog () {
if (!this.selectedSupplierPart || !this.selectedSupplierPart.partNo || !this.selectedSupplierPart.supplierCode) {
this.$message.warning('请先选择供应商物料')
return
}
const basePartNo = (this.selectedSupplierPart.basePartNo || '').trim()
if (!basePartNo) {
this.$message.warning('本物料没有基准物料编码')
return
}
this.copyForm = {
site: this.$store.state.user.site,
supplierCode: this.selectedSupplierPart.supplierCode,
sourcePartNo: this.selectedSupplierPart.partNo,
basePartNo
}
this.copySelectionRows = []
this.copyDialogLoading = true
listCopySeriesPart({
site: this.$store.state.user.site,
supplierCode: this.selectedSupplierPart.supplierCode,
sourcePartNo: this.selectedSupplierPart.partNo
}).then(({ data }) => {
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 () { openTierDialog () {
if (!this.selectedSupplierPart) { if (!this.selectedSupplierPart) {
this.$message.warning('请先选择供应商物料') this.$message.warning('请先选择供应商物料')

Loading…
Cancel
Save