|
|
@ -78,11 +78,6 @@ |
|
|
empty-text="点击查询查看数据" |
|
|
empty-text="点击查询查看数据" |
|
|
@row-click="handleTopRowClick" |
|
|
@row-click="handleTopRowClick" |
|
|
> |
|
|
> |
|
|
<el-table-column fixed="right" label="操作" width="130" header-align="center" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link style="cursor: pointer" @click.stop="openMoqDialog(scope.row)">维护MOQ</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="supplierCode" label="供应商编号" min-width="120" header-align="center" align="center" /> |
|
|
<el-table-column prop="supplierCode" label="供应商编号" min-width="120" header-align="center" align="center" /> |
|
|
<el-table-column prop="supplierName" label="供应商名称" min-width="180" header-align="center" align="left" show-overflow-tooltip /> |
|
|
<el-table-column prop="supplierName" label="供应商名称" min-width="180" header-align="center" align="left" show-overflow-tooltip /> |
|
|
<el-table-column prop="currency" label="币种" min-width="90" header-align="center" align="center" /> |
|
|
<el-table-column prop="currency" label="币种" min-width="90" header-align="center" align="center" /> |
|
|
@ -138,62 +133,6 @@ |
|
|
<el-table-column prop="remark" label="备注" min-width="180" header-align="center" align="left" show-overflow-tooltip /> |
|
|
<el-table-column prop="remark" label="备注" min-width="180" header-align="center" align="left" show-overflow-tooltip /> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
|
title="维护MOQ" |
|
|
|
|
|
:visible.sync="moqDialogVisible" |
|
|
|
|
|
width="640px" |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
v-drag |
|
|
|
|
|
> |
|
|
|
|
|
<el-form label-position="top" :model="moqForm"> |
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="供应商编号"> |
|
|
|
|
|
<el-input v-model="moqForm.supplierCode" disabled /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="产品编码"> |
|
|
|
|
|
<el-input v-model="moqForm.partNo" disabled /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="MOQ/COLOR" required> |
|
|
|
|
|
<el-input-number v-model="moqForm.moqColor" :min="0" :controls="false" style="width: 100%" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="QTY/PO" required> |
|
|
|
|
|
<el-input-number v-model="moqForm.moq" :min="0" :controls="false" style="width: 100%" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="QTY/CARTON" required> |
|
|
|
|
|
<el-input-number v-model="moqForm.qtyCarton" :min="0" :controls="false" style="width: 100%" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
<el-col :span="8"> |
|
|
|
|
|
<el-form-item label="是否在用"> |
|
|
|
|
|
<el-select v-model="moqForm.active" style="width: 100%"> |
|
|
|
|
|
<el-option label="是" value="Y" /> |
|
|
|
|
|
<el-option label="否" value="N" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" :disabled="moqSaveLoading" @click="saveMoq"> |
|
|
|
|
|
{{ moqSaveLoading ? '保存中...' : '保存' }} |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button :disabled="moqSaveLoading" @click="moqDialogVisible = false">取消</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
<el-dialog |
|
|
title="新增供应商物料" |
|
|
title="新增供应商物料" |
|
|
:visible.sync="addDialogVisible" |
|
|
:visible.sync="addDialogVisible" |
|
|
@ -371,6 +310,39 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
<div class="attachment-header"> |
|
|
|
|
|
<span>维护MOQ</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<el-form label-position="top" :model="tierForm"> |
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-form-item label="MOQ/COLOR" required> |
|
|
|
|
|
<el-input-number v-model="tierForm.moqColor" :min="0" :controls="false" style="width: 100%" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-form-item label="QTY/PO" required> |
|
|
|
|
|
<el-input-number v-model="tierForm.moq" :min="0" :controls="false" style="width: 100%" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-form-item label="QTY/CARTON" required> |
|
|
|
|
|
<el-input-number v-model="tierForm.qtyCarton" :min="0" :controls="false" style="width: 100%" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-form-item label="是否在用"> |
|
|
|
|
|
<el-select v-model="tierForm.active" style="width: 100%"> |
|
|
|
|
|
<el-option label="是" value="Y" /> |
|
|
|
|
|
<el-option label="否" value="N" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<div class="attachment-header"> |
|
|
|
|
|
<span>阶梯价格</span> |
|
|
|
|
|
</div> |
|
|
<div class="rq "> |
|
|
<div class="rq "> |
|
|
<el-table :height="300" :data="tierForm.tierPriceList" border stripe style="width: 100%; margin-top: 5px;"> |
|
|
<el-table :height="300" :data="tierForm.tierPriceList" border stripe style="width: 100%; margin-top: 5px;"> |
|
|
<el-table-column type="index" label="#" width="50" header-align="center" align="center" /> |
|
|
<el-table-column type="index" label="#" width="50" header-align="center" align="center" /> |
|
|
@ -521,17 +493,6 @@ export default { |
|
|
supplierPartList: [], |
|
|
supplierPartList: [], |
|
|
selectedSupplierPart: null, |
|
|
selectedSupplierPart: null, |
|
|
currentTierPriceList: [], |
|
|
currentTierPriceList: [], |
|
|
moqDialogVisible: false, |
|
|
|
|
|
moqSaveLoading: false, |
|
|
|
|
|
moqForm: { |
|
|
|
|
|
site: '', |
|
|
|
|
|
supplierCode: '', |
|
|
|
|
|
partNo: '', |
|
|
|
|
|
moq: 0, |
|
|
|
|
|
moqColor: 0, |
|
|
|
|
|
qtyCarton: 0, |
|
|
|
|
|
active: 'Y' |
|
|
|
|
|
}, |
|
|
|
|
|
addDialogVisible: false, |
|
|
addDialogVisible: false, |
|
|
addSaveLoading: false, |
|
|
addSaveLoading: false, |
|
|
addForm: { |
|
|
addForm: { |
|
|
@ -570,6 +531,10 @@ export default { |
|
|
sku: '', |
|
|
sku: '', |
|
|
partDesc: '', |
|
|
partDesc: '', |
|
|
priceDate: '', |
|
|
priceDate: '', |
|
|
|
|
|
moq: 0, |
|
|
|
|
|
moqColor: 0, |
|
|
|
|
|
qtyCarton: 0, |
|
|
|
|
|
active: 'Y', |
|
|
tierPriceList: [] |
|
|
tierPriceList: [] |
|
|
}, |
|
|
}, |
|
|
attachmentLoading: false, |
|
|
attachmentLoading: false, |
|
|
@ -764,52 +729,6 @@ export default { |
|
|
this.bottomLoading = false |
|
|
this.bottomLoading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
|
|
|
* 打开维护弹窗。三个数量顺序为 MOQ/COLOR、QTY/PO、QTY/CARTON,空值按 0。 |
|
|
|
|
|
*/ |
|
|
|
|
|
openMoqDialog (row) { |
|
|
|
|
|
this.moqForm = { |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
supplierCode: row.supplierCode, |
|
|
|
|
|
partNo: row.partNo, |
|
|
|
|
|
moq: this.normalizeNumberValue(row.moq, 0), |
|
|
|
|
|
moqColor: this.normalizeNumberValue(row.moqColor, 0), |
|
|
|
|
|
qtyCarton: this.normalizeNumberValue(row.qtyCarton, 0), |
|
|
|
|
|
active: row.active || 'Y' |
|
|
|
|
|
} |
|
|
|
|
|
this.moqDialogVisible = true |
|
|
|
|
|
}, |
|
|
|
|
|
/** |
|
|
|
|
|
* 保存维护弹窗。三个数量都不能为空且不能小于 0,site 取当前登录站点。 |
|
|
|
|
|
*/ |
|
|
|
|
|
saveMoq () { |
|
|
|
|
|
if (!this.validateQtyFields(this.moqForm)) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.moqSaveLoading = true |
|
|
|
|
|
const inData = { |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
supplierCode: this.moqForm.supplierCode, |
|
|
|
|
|
partNo: this.moqForm.partNo, |
|
|
|
|
|
moq: this.moqForm.moq, |
|
|
|
|
|
moqColor: this.moqForm.moqColor, |
|
|
|
|
|
qtyCarton: this.moqForm.qtyCarton, |
|
|
|
|
|
active: this.moqForm.active |
|
|
|
|
|
} |
|
|
|
|
|
saveSupplierPartMoq(inData).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.$message.success('保存成功') |
|
|
|
|
|
this.moqDialogVisible = false |
|
|
|
|
|
this.searchSupplierPartList() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$alert((data && data.msg) || '保存失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message.error('保存失败') |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.moqSaveLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
openAddDialog () { |
|
|
openAddDialog () { |
|
|
this.addForm = { |
|
|
this.addForm = { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
@ -931,6 +850,8 @@ export default { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.$message.success('复制成功') |
|
|
this.$message.success('复制成功') |
|
|
this.copyDialogVisible = false |
|
|
this.copyDialogVisible = false |
|
|
|
|
|
// 复制会同步价格与 MOQ,成功后刷新列表以展示最新数据 |
|
|
|
|
|
this.searchSupplierPartList() |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.$message.error((data && data.msg) || '复制失败') |
|
|
this.$message.error((data && data.msg) || '复制失败') |
|
|
@ -954,6 +875,11 @@ export default { |
|
|
sku: this.selectedSupplierPart.sku || '', |
|
|
sku: this.selectedSupplierPart.sku || '', |
|
|
partDesc: this.selectedSupplierPart.partDesc || '', |
|
|
partDesc: this.selectedSupplierPart.partDesc || '', |
|
|
priceDate: this.getTodayDate(), |
|
|
priceDate: this.getTodayDate(), |
|
|
|
|
|
// MOQ 页签回显当前选中行的起订量与在用状态 |
|
|
|
|
|
moq: this.normalizeNumberValue(this.selectedSupplierPart.moq, 0), |
|
|
|
|
|
moqColor: this.normalizeNumberValue(this.selectedSupplierPart.moqColor, 0), |
|
|
|
|
|
qtyCarton: this.normalizeNumberValue(this.selectedSupplierPart.qtyCarton, 0), |
|
|
|
|
|
active: this.selectedSupplierPart.active || 'Y', |
|
|
tierPriceList: (this.currentTierPriceList || []).map(item => ({ |
|
|
tierPriceList: (this.currentTierPriceList || []).map(item => ({ |
|
|
qtyStart: this.normalizeNumberValue(item.qtyStart, 0), |
|
|
qtyStart: this.normalizeNumberValue(item.qtyStart, 0), |
|
|
qtyEnd: this.normalizeNumberValue(item.qtyEnd, 0), |
|
|
qtyEnd: this.normalizeNumberValue(item.qtyEnd, 0), |
|
|
@ -1067,8 +993,12 @@ export default { |
|
|
if (!this.validateTierRows()) { |
|
|
if (!this.validateTierRows()) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
// MOQ 页签与阶梯价一起提交,三个起订量需校验 |
|
|
|
|
|
if (!this.validateQtyFields(this.tierForm)) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.tierSaveLoading = true |
|
|
this.tierSaveLoading = true |
|
|
const inData = { |
|
|
|
|
|
|
|
|
const priceInData = { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
supplierCode: this.tierForm.supplierCode, |
|
|
supplierCode: this.tierForm.supplierCode, |
|
|
partNo: this.tierForm.partNo, |
|
|
partNo: this.tierForm.partNo, |
|
|
@ -1082,13 +1012,25 @@ export default { |
|
|
remark: item.remark || '' |
|
|
remark: item.remark || '' |
|
|
})) |
|
|
})) |
|
|
} |
|
|
} |
|
|
saveTierPrice(inData).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
|
|
|
const moqInData = { |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
supplierCode: this.tierForm.supplierCode, |
|
|
|
|
|
partNo: this.tierForm.partNo, |
|
|
|
|
|
moq: this.tierForm.moq, |
|
|
|
|
|
moqColor: this.tierForm.moqColor, |
|
|
|
|
|
qtyCarton: this.tierForm.qtyCarton, |
|
|
|
|
|
active: this.tierForm.active |
|
|
|
|
|
} |
|
|
|
|
|
Promise.all([saveTierPrice(priceInData), saveSupplierPartMoq(moqInData)]).then(([priceRes, moqRes]) => { |
|
|
|
|
|
const priceData = priceRes && priceRes.data |
|
|
|
|
|
const moqData = moqRes && moqRes.data |
|
|
|
|
|
if (priceData && priceData.code === 0 && moqData && moqData.code === 0) { |
|
|
this.$message.success('保存成功') |
|
|
this.$message.success('保存成功') |
|
|
this.tierDialogVisible = false |
|
|
this.tierDialogVisible = false |
|
|
this.loadCurrentTierPrice() |
|
|
|
|
|
|
|
|
// 刷新上表以同步 MOQ 列,并重载当前阶梯价 |
|
|
|
|
|
this.searchSupplierPartList() |
|
|
} else { |
|
|
} else { |
|
|
this.$alert((data && data.msg) || '保存失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
|
|
|
|
|
this.$alert((priceData && priceData.msg) || (moqData && moqData.msg) || '保存失败', '错误', { confirmButtonText: '确定' }) |
|
|
} |
|
|
} |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
this.$message.error('保存失败') |
|
|
this.$message.error('保存失败') |
|
|
|