|
|
@ -6,8 +6,6 @@ |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="selectCustomer()">选择客户</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="settleAccounts()">结算</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="print()">打印</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -202,71 +200,6 @@ |
|
|
|
</div> |
|
|
|
<!-- 选择客户 --> |
|
|
|
<selectCustomer v-show="viewState == 2" ref="divCus" @backData="backData" @doback="resetState"/> |
|
|
|
<!-- 结算 --> |
|
|
|
<el-dialog :visible.sync="settleVisible" width="70%"> |
|
|
|
<el-form ref="formobj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|
|
|
<el-row style="border-top: 1px solid #e0e3eb"> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>付款人姓名</div> |
|
|
|
<el-form-item prop="settlementVo.payerName"><el-input class="addinputInfo addinputw" v-model="formobj.settlementVo.payerName" clearable placeholder="" /></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">付款人编号</div> |
|
|
|
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.settlementVo.payerNo" clearable placeholder="" /></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">应收金额</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ ysjeTotal }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">订金抵扣</div> |
|
|
|
<el-form-item><el-input class="addinputInfo addinputw" @keyup.native="formobj.settlementVo.depositdeductAmount = getNumber(formobj.settlementVo.depositdeductAmount, 2)" v-model="formobj.settlementVo.depositdeductAmount" clearable placeholder="" /></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>结算方式</div> |
|
|
|
<el-form-item prop="settlementVo.settleValue"> |
|
|
|
<el-select class="addinputInfo" v-model="formobj.settlementVo.settleValue" placeholder="请选择" @change="settleChange" clearable filterable> |
|
|
|
<el-option v-for="item in settle_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>结算金额</div> |
|
|
|
<el-form-item prop="settlementVo.settleAmount"><el-input class="addinputInfo addinputw" @keyup.native="formobj.settlementVo.settleAmount = getNumber(formobj.settlementVo.settleAmount, 2)" v-model="formobj.settlementVo.settleAmount" clearable placeholder="" /></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">其他结算方式</div> |
|
|
|
<el-form-item> |
|
|
|
<el-select class="addinputInfo" v-model="formobj.settlementVo.otherSettleValue" placeholder="请选择" @change="otherSettleChange" clearable filterable> |
|
|
|
<el-option v-for="item in otherSettle_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">其他结算金额</div> |
|
|
|
<el-form-item><el-input class="addinputInfo addinputw" @keyup.native="formobj.settlementVo.otherSettleAmount = getNumber(formobj.settlementVo.otherSettleAmount, 2)" v-model="formobj.settlementVo.otherSettleAmount" clearable placeholder="" /></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">欠款金额</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ qkjeTotal }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>结算时间</div> |
|
|
|
<el-form-item prop="settlementVo.settleTime"><el-date-picker class="addinputInfo addinputw" v-model="formobj.settlementVo.settleTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期" /></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<div style="text-align:center;margin-top: 20px;"> |
|
|
|
<el-button type="primary" size="mini" @click="confirm">确 定</el-button> |
|
|
|
<el-button type="info " size="mini" @click="settleVisible = false">取 消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@ -289,11 +222,8 @@ export default { |
|
|
|
submitdisabled: false, |
|
|
|
user_list: [], // 销售人员 |
|
|
|
subject_list: [], // 科目 |
|
|
|
settleVisible: false, // 结算弹框 |
|
|
|
invoiceType_list: [], // 发票类型 |
|
|
|
companyInvoicing_list: [], // 开票单位 |
|
|
|
settle_list: [], // 结算方式 |
|
|
|
otherSettle_list: [], // 其他结算方式 |
|
|
|
activeNames: '1', |
|
|
|
index: 0, |
|
|
|
// commodity商品 |
|
|
@ -430,12 +360,6 @@ export default { |
|
|
|
let ysje = '0' |
|
|
|
ysje = Math.round((parseFloat(ysje) + parseFloat(this.jeTotal) - parseFloat(this.yhTotal)) * 100) / 100 |
|
|
|
return ysje |
|
|
|
}, |
|
|
|
// 结算页面中计算欠款金额 = 应付金额 - 订金抵扣 - 结算金额 - 其他结算金额 |
|
|
|
qkjeTotal() { |
|
|
|
let qkje = '0' |
|
|
|
qkje = Math.round((parseFloat(this.ysjeTotal) - parseFloat(this.formobj.settlementVo.depositdeductAmount !== '' ? this.formobj.settlementVo.depositdeductAmount : '0') - parseFloat(this.formobj.settlementVo.settleAmount !== '' ? this.formobj.settlementVo.settleAmount : '0') - parseFloat(this.formobj.settlementVo.otherSettleAmount !== '' ? this.formobj.settlementVo.otherSettleAmount : '0')) * 100) / 100 |
|
|
|
return qkje |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -450,16 +374,6 @@ export default { |
|
|
|
this.companyInvoicing_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ type: 'settle' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.settle_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ type: 'otherSettle' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.otherSettle_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
selSubjectInfo({ useOrgSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.subject_list = resp.data |
|
|
@ -786,84 +700,6 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
settleAccounts() { |
|
|
|
this.settleVisible = true |
|
|
|
}, |
|
|
|
settleChange(value) { |
|
|
|
const choose = this.settle_list.filter((item) => item.dictValue === value) |
|
|
|
if (choose.length > 0 && choose !== null) { |
|
|
|
this.formobj.settlementVo.settleKey = choose[0].dictKey |
|
|
|
} else { |
|
|
|
this.formobj.settlementVo.settleKey = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
otherSettleChange(value) { |
|
|
|
const choose = this.otherSettle_list.filter((item) => item.dictValue === value) |
|
|
|
if (choose.length > 0 && choose !== null) { |
|
|
|
this.formobj.settlementVo.otherSettleKey = choose[0].dictKey |
|
|
|
} else { |
|
|
|
this.formobj.settlementVo.otherSettleKey = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
confirm() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.formobj.customerName === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '客户信息不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.formobj.goodsVos.length === 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '商品列表不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.formobj.receivableAmount = this.ysjeTotal |
|
|
|
this.formobj.discountAmount = this.yhTotal |
|
|
|
this.formobj.goodsAmount = this.clfTotal // 材料费 |
|
|
|
this.formobj.addAmount = this.fjfTotal // 附加费 |
|
|
|
this.submitdisabled = true |
|
|
|
req.settle(this.formobj).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '结算成功' }) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.submitdisabled = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
print() { |
|
|
|
if (this.formobj.sid !== '') { |
|
|
|
req.printSmsBill({ sid: this.formobj.sid, userSid: this.formobj.createBySid, createOrgSid: this.formobj.createOrgSid, useOrgSid: this.formobj.deptSid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
|
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + res.data + '&outFileName=' + '销售单', true) |
|
|
|
xhr.setRequestHeader('token', getStorage()) |
|
|
|
xhr.responseType = 'blob' |
|
|
|
xhr.onload = function(e) { |
|
|
|
// 如果请求执行成功 |
|
|
|
var blob = this.response |
|
|
|
var filename = '销售单.pdf' |
|
|
|
var a = document.createElement('a') |
|
|
|
// blob.type="application/octet-stream"; |
|
|
|
// 创键临时url对象 |
|
|
|
var url = URL.createObjectURL(blob) |
|
|
|
a.href = url |
|
|
|
a.download = filename |
|
|
|
a.click() |
|
|
|
// 释放之前创建的URL对象 |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
} |
|
|
|
// 发送请求 |
|
|
|
xhr.send() |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请保存相关信息后在进行打印' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.viewState = 1 |
|
|
|
}, |
|
|
@ -928,7 +764,6 @@ export default { |
|
|
|
} |
|
|
|
this.commodityData = [] |
|
|
|
this.subjoinData = [] |
|
|
|
this.settleVisible = false |
|
|
|
this.submitdisabled = false |
|
|
|
this.$emit('doback') |
|
|
|
} |
|
|
|