Browse Source

供应商

master
常熟吴彦祖 2 weeks ago
parent
commit
efebc4419d
  1. 26
      src/views/modules/supplier/purHeaderList.vue
  2. 19
      src/views/modules/supplier/quoPurDetailList.vue
  3. 8
      src/views/modules/supplier/supPurReplyHistList.vue

26
src/views/modules/supplier/purHeaderList.vue

@ -73,7 +73,7 @@
<!-- 子表物料明细列表 - 始终显示表头 --> <!-- 子表物料明细列表 - 始终显示表头 -->
<div class="sub-title"> <div class="sub-title">
物料明细列表 物料明细列表
<el-button type="primary" class="customer-bun-min" @click="openMaterialDialog()" style="margin-left: 10px;">新增物料</el-button>
<el-button v-if="canAddMaterial()" type="primary" class="customer-bun-min" @click="openMaterialDialog()" style="margin-left: 10px;">新增物料</el-button>
</div> </div>
<el-table <el-table
@ -84,8 +84,8 @@
style="width:100%"> style="width:100%">
<el-table-column fixed="right" label="操作" header-align="center" align="center" width="160"> <el-table-column fixed="right" label="操作" header-align="center" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link style="cursor: pointer" @click="openMaterialDialog(scope.row)">编辑 |</el-link>
<el-link style="cursor: pointer" @click="deleteMaterial(scope.row)">删除 |</el-link>
<el-link v-if="isMaterialEditable(scope.row)" style="cursor: pointer" @click="openMaterialDialog(scope.row)">编辑 |</el-link>
<el-link v-if="isMaterialEditable(scope.row)" style="cursor: pointer" @click="deleteMaterial(scope.row)">删除 |</el-link>
<el-link style="cursor: pointer" @click="openUploadDialog(scope.row)">附件</el-link> <el-link style="cursor: pointer" @click="openUploadDialog(scope.row)">附件</el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -944,15 +944,29 @@ export default {
}, },
// //
isMaterialEditable(row) {
return row && (row.status === '待提交' || row.status === '待报价')
},
canAddMaterial() {
return this.currentInquiry && (this.currentInquiry.status === '待提交' || this.currentInquiry.status === '待报价')
},
openMaterialDialog(row) { openMaterialDialog(row) {
if (!this.currentInquiry) { if (!this.currentInquiry) {
this.$message.warning('请先选择一个询价单') this.$message.warning('请先选择一个询价单')
return return
} }
if (row) { if (row) {
if (!this.isMaterialEditable(row)) {
this.$message.warning('只有待提交或待报价状态的明细可以编辑')
return
}
this.materialDialogTitle = '编辑物料' this.materialDialogTitle = '编辑物料'
this.materialForm = { ...row } this.materialForm = { ...row }
} else { } else {
if (!this.canAddMaterial()) {
this.$message.warning('当前询价单状态不允许新增物料')
return
}
this.materialDialogTitle = '新增物料' this.materialDialogTitle = '新增物料'
this.materialForm = { this.materialForm = {
id: null, id: null,
@ -963,7 +977,7 @@ export default {
spec: '', spec: '',
qty: 0, qty: 0,
remark2: '', remark2: '',
status: '待提交'
status: this.currentInquiry.status === '待报价' ? '待报价' : '待提交'
} }
} }
this.materialDialogVisible = true this.materialDialogVisible = true
@ -1043,6 +1057,10 @@ export default {
}) })
}, },
deleteMaterial(row) { deleteMaterial(row) {
if (!this.isMaterialEditable(row)) {
this.$message.warning('只有待提交或待报价状态的明细可以删除')
return
}
this.$confirm('确定删除物料: ' + row.partNo + ' ?', '提示', { type: 'warning' }).then(() => { this.$confirm('确定删除物料: ' + row.partNo + ' ?', '提示', { type: 'warning' }).then(() => {
deleteMaterial({ id: row.id }).then(({data}) => { deleteMaterial({ id: row.id }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {

19
src/views/modules/supplier/quoPurDetailList.vue

@ -382,7 +382,19 @@ export default {
createdBy: this.$store.state.user.name createdBy: this.$store.state.user.name
}, },
quoteRules: { quoteRules: {
price: [{ required: true, message: '请输入未税单价', trigger: 'blur' }],
price: [
{ required: true, message: '请输入未税单价', trigger: 'blur' },
{
validator: (rule, value, callback) => {
if (value == null || Number(value) <= 0) {
callback(new Error('未税单价必须大于0'))
} else {
callback()
}
},
trigger: 'blur'
}
],
taxRate: [{ required: true, message: '请输入税率', trigger: 'blur' }] taxRate: [{ required: true, message: '请输入税率', trigger: 'blur' }]
}, },
// //
@ -567,8 +579,13 @@ export default {
// //
submitQuote() { submitQuote() {
this.calculatePrice()
this.$refs.quoteForm.validate((valid) => { this.$refs.quoteForm.validate((valid) => {
if (valid) { if (valid) {
if (!this.quoteForm.price || Number(this.quoteForm.price) <= 0) {
this.$message.error('未税单价必须大于0')
return
}
// //
const totalCost = this.quoteForm.materialCost + this.quoteForm.produceFee + const totalCost = this.quoteForm.materialCost + this.quoteForm.produceFee +
this.quoteForm.surfaceFee + this.quoteForm.profit + this.quoteForm.surfaceFee + this.quoteForm.profit +

8
src/views/modules/supplier/supPurReplyHistList.vue

@ -11,6 +11,13 @@
<el-form-item :label="'物料名称'"> <el-form-item :label="'物料名称'">
<el-input v-model="searchData.partDesc" placeholder="物料名称" style="width:200px" @keyup.enter.native="getList" /> <el-input v-model="searchData.partDesc" placeholder="物料名称" style="width:200px" @keyup.enter.native="getList" />
</el-form-item> </el-form-item>
<el-form-item :label="'状态'">
<el-select v-model="searchData.approvalFilter" placeholder="请选择" style="width:120px">
<el-option label="全部" value="all" />
<el-option label="需要审批" value="need" />
<el-option label="不需要审批" value="none" />
</el-select>
</el-form-item>
<el-form-item :label="'报价日期'"> <el-form-item :label="'报价日期'">
<el-date-picker <el-date-picker
style="width: 130px" style="width: 130px"
@ -559,6 +566,7 @@ export default {
partNo: '', partNo: '',
partDesc: '', partDesc: '',
status: '', status: '',
approvalFilter: 'need',
notExistsStatus: '已关闭' notExistsStatus: '已关闭'
}, },

Loading…
Cancel
Save