|
|
@ -27,11 +27,16 @@ |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>采购类型</div> |
|
|
|
<div class="span-sty"><span class="icon">*</span>采购方式</div> |
|
|
|
<el-form-item prop="purchaseTypeValue"> |
|
|
|
<el-select class="addinputInfo" v-model="formobj.purchaseTypeValue" placeholder="请选择" @change="purchaseTypeChange" clearable filterable> |
|
|
|
<el-option v-for="item in procurementType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
<div class="addinputInfo" style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center"> |
|
|
|
<el-select v-model="formobj.purchaseTypeValue" placeholder="请选择" @change="purchaseTypeChange" clearable filterable> |
|
|
|
<el-option v-for="item in procurementType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
<el-select v-show="formobj.purchaseTypeValue == '代理库'" style="margin-left: 5px" v-model="formobj.operateBrandValue" placeholder="选择经营品牌" @change="operateBrandChange" clearable filterable> |
|
|
|
<el-option v-for="item in operateBrand_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
@ -55,13 +60,18 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>供应商</div> |
|
|
|
<el-form-item prop="supplierSid"> |
|
|
|
<el-select class="addinputInfo" v-model="formobj.supplierSid" placeholder="请选择" @change="supplierChange" clearable filterable> |
|
|
|
<el-option v-for="item in supplier_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|
|
|
</el-select> |
|
|
|
<div class="addinputInfo" style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center"> |
|
|
|
<el-select v-model="formobj.supplierSid" placeholder="请选择" @change="supplierChange" clearable filterable> |
|
|
|
<el-option v-for="item in supplier_list" :key="item.sid" :label="item.supplierName" :value="item.sid"></el-option> |
|
|
|
</el-select> |
|
|
|
<el-select v-show="formobj.purchaseTypeValue == '代理库'" style="margin-left: 5px" v-model="formobj.warehouseTypeValue" placeholder="选择仓库类型" @change="warehouseTypeChange" clearable filterable> |
|
|
|
<el-option v-for="item in warehouseType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>是否需要发票</div> |
|
|
|
<div class="span-sty"><span class="icon">*</span>是否开发票</div> |
|
|
|
<el-form-item prop="purchaseBillInvoice.isInvoicing"> |
|
|
|
<el-radio-group class="addinputInfo" @change="isInvoicingChange" v-model="formobj.purchaseBillInvoice.isInvoicing"> |
|
|
|
<el-radio label="1">是</el-radio> |
|
|
@ -117,16 +127,12 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" v-if="formobj.purchasePay.isFirstPay == '0'"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>验货后付货款</div> |
|
|
|
<el-form-item prop="purchasePay.goodsMoney"> |
|
|
|
<el-input class="addinputInfo addinputw" @keyup.native="formobj.purchasePay.goodsMoney = getNumber(formobj.purchasePay.goodsMoney, 2)" v-model="formobj.purchasePay.goodsMoney" clearable placeholder=""/> |
|
|
|
</el-form-item> |
|
|
|
<div class="span-sty">验货后付货款</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ calculateGoodsMoney }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="16" v-else> |
|
|
|
<div class="span-sty"><span class="icon">*</span>审批通过后付货款</div> |
|
|
|
<el-form-item prop="purchasePay.goodsMoney"> |
|
|
|
<el-input class="addinputInfo addinputw" @keyup.native="formobj.purchasePay.goodsMoney = getNumber(formobj.purchasePay.goodsMoney, 2)" v-model="formobj.purchasePay.goodsMoney" clearable placeholder=""/> |
|
|
|
</el-form-item> |
|
|
|
<div class="span-sty">审批通过后付货款</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ calculateGoodsMoney }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
@ -245,9 +251,11 @@ export default { |
|
|
|
index: 0, |
|
|
|
accept: '.jpg,.jpeg,.png', |
|
|
|
procurementType_list: [], |
|
|
|
operateBrand_list: [], |
|
|
|
procurementReason_list: [], |
|
|
|
paymentMethod_list: [], |
|
|
|
supplier_list: [], |
|
|
|
warehouseType_list: [], |
|
|
|
account_list: [], |
|
|
|
formobj: { |
|
|
|
sid: '', |
|
|
@ -288,6 +296,10 @@ export default { |
|
|
|
useOrgName: '', |
|
|
|
createOrgSid: '', |
|
|
|
createOrgName: '', |
|
|
|
operateBrandKey: '', |
|
|
|
operateBrandValue: '', |
|
|
|
warehouseTypeKey: '', |
|
|
|
warehouseTypeValue: '', |
|
|
|
purchasePay: { |
|
|
|
sid: '', |
|
|
|
billSid: '', |
|
|
@ -312,14 +324,13 @@ export default { |
|
|
|
pmsPurchaseBillDetailList: [] |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
purchaseTypeValue: [{ required: true, message: '采购类型不能为空', trigger: 'change' }], |
|
|
|
purchaseTypeValue: [{ required: true, message: '采购方式不能为空', trigger: 'change' }], |
|
|
|
purchaseReasonValue: [{ required: true, message: '采购原因不能为空', trigger: 'change' }], |
|
|
|
payTypeValue: [{ required: true, message: '付款方式不能为空', trigger: 'change' }], |
|
|
|
supplierSid: [{ required: true, message: '供应商不能为空', trigger: 'change' }], |
|
|
|
'purchaseBillInvoice.isInvoicing': [{ required: true, message: '是否需要发票不能为空', trigger: 'change' }], |
|
|
|
'purchaseBillInvoice.isInvoicing': [{ required: true, message: '是否开发票不能为空', trigger: 'change' }], |
|
|
|
'purchasePay.isFirstPay': [{ required: true, message: '是否先付货款不能为空', trigger: 'change' }], |
|
|
|
'purchasePay.deposit': [{ required: true, message: '审批通过后付订金不能为空', trigger: 'blur' }], |
|
|
|
'purchasePay.goodsMoney': [{ required: true, message: '付货款不能为空', trigger: 'blur' }] |
|
|
|
'purchasePay.deposit': [{ required: true, message: '审批通过后付订金不能为空', trigger: 'blur' }] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -348,10 +359,25 @@ export default { |
|
|
|
} |
|
|
|
return cg |
|
|
|
}, |
|
|
|
// 应付金额 |
|
|
|
yfTotal() { |
|
|
|
let yf = '0' |
|
|
|
yf = Math.round((parseFloat(yf) + parseFloat(this.cgTotal) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0') + parseFloat(this.formobj.errorAmount !== '' ? this.formobj.errorAmount : '0')) * 100) / 100 |
|
|
|
return yf |
|
|
|
}, |
|
|
|
// 付货款 |
|
|
|
calculateGoodsMoney() { |
|
|
|
let goodsMoney = '0' |
|
|
|
if (this.formobj.payTypeValue === '单笔付款') { |
|
|
|
if (this.formobj.purchasePay.isFirstPay === '1') { |
|
|
|
// 是否先付货款为是,计算审批通过后付货款 = 应付金额 |
|
|
|
goodsMoney = this.yfTotal |
|
|
|
} else if (this.formobj.purchasePay.isFirstPay === '0') { |
|
|
|
// 是否先付货款为否,计算验货后付货款 = 应付金额 - 审批通过后付订金 |
|
|
|
goodsMoney = parseFloat(this.yfTotal) - parseFloat(this.formobj.purchasePay.deposit !== '' ? this.formobj.purchasePay.deposit : '0') |
|
|
|
} |
|
|
|
} |
|
|
|
return goodsMoney |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -361,6 +387,16 @@ export default { |
|
|
|
this.procurementType_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ type: 'operateBrand' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.operateBrand_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ type: 'warehouseType' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.warehouseType_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ type: 'procurementReason' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.procurementReason_list = res.data |
|
|
@ -441,6 +477,14 @@ export default { |
|
|
|
this.formobj.purchaseTypeKey = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
operateBrandChange(value) { |
|
|
|
const choose = this.operateBrand_list.filter((item) => item.dictValue === value) |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
|
this.formobj.operateBrandKey = choose[0].dictKey |
|
|
|
} else { |
|
|
|
this.formobj.operateBrandKey = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
purchaseReasonChange(value) { |
|
|
|
const choose = this.procurementReason_list.filter((item) => item.dictValue === value) |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
@ -467,6 +511,14 @@ export default { |
|
|
|
this.account_list = [] |
|
|
|
} |
|
|
|
}, |
|
|
|
warehouseTypeChange(value) { |
|
|
|
const choose = this.warehouseType_list.filter((item) => item.dictValue === value) |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
|
this.formobj.warehouseTypeKey = choose[0].dictKey |
|
|
|
} else { |
|
|
|
this.formobj.warehouseTypeKey = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
isInvoicingChange(val) { |
|
|
|
if (val === '1') { |
|
|
|
const choose = this.supplier_list.filter((item) => item.sid === this.formobj.supplierSid) |
|
|
@ -538,6 +590,7 @@ export default { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
this.formobj.payableAmount = this.yfTotal |
|
|
|
this.formobj.purchasePay.goodsMoney = this.calculateGoodsMoney |
|
|
|
req.saveOrUpdate(this.formobj).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
|
@ -556,6 +609,7 @@ export default { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
this.formobj.payableAmount = this.yfTotal |
|
|
|
this.formobj.purchasePay.goodsMoney = this.calculateGoodsMoney |
|
|
|
req.submit(this.formobj).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '提交成功' }) |
|
|
@ -610,6 +664,10 @@ export default { |
|
|
|
useOrgName: '', |
|
|
|
createOrgSid: '', |
|
|
|
createOrgName: '', |
|
|
|
operateBrandKey: '', |
|
|
|
operateBrandValue: '', |
|
|
|
warehouseTypeKey: '', |
|
|
|
warehouseTypeValue: '', |
|
|
|
purchasePay: { |
|
|
|
sid: '', |
|
|
|
billSid: '', |
|
|
|