业务员2可编辑,审批是必填,开票文件下载金额重新计算,扣重保留三位

main
tengxi 1 year ago
parent d9366892a8
commit c721e336f1

@ -278,7 +278,7 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
lineCell7.setCellValue(String.valueOf(map.get("tareWeight")).equals("null") ? "" : String.valueOf(map.get("tareWeight")));
lineCell7.setCellStyle(lineStyle);
//扣重
lineCell8.setCellValue(String.valueOf(map.get("buckleWeight")).equals("null") ? "" : String.valueOf(map.get("buckleWeight")));
lineCell8.setCellStyle(lineStyle);
@ -756,13 +756,21 @@ public class PurchaseorderitemServiceImpl extends ServiceImpl<PurchaseorderitemM
Integer settlement = 0;
BigDecimal settlementSum = new BigDecimal(settlement);
Integer amount = 0;
BigDecimal amountSum = new BigDecimal(amount);
BigDecimal amountSum1 = new BigDecimal("0.000");
BigDecimal amountSum2 = new BigDecimal("0.000");
BigDecimal decimal = new BigDecimal("0.00");
BigDecimal decimalsettlement = new BigDecimal("0.000");
for (int i = 0; i < reportList.size(); i++) {
HashMap<String, Object> map1 = reportList.get(i);
settlementSum = settlementSum.add(map1.get("settlement") != null ? (BigDecimal) map1.get("settlement") : decimalsettlement);
amountSum = amountSum.add(map1.get("amount") != null ? (BigDecimal) map1.get("amount") : decimal);
// amountSum = amountSum.add(map1.get("amount") != null ? (BigDecimal) map1.get("amount") : decimal);
amountSum1 = map1.get("settlement") != null ? (BigDecimal) map1.get("settlement") : decimal;
amountSum2 = map1.get("price") != null ? (BigDecimal) map1.get("price") : decimal;
amountSum =amountSum.add(amountSum1.multiply(amountSum2));
// map1.get("price")
}
map.put("settlementSum", settlementSum);
map.put("amountSum", amountSum);

@ -102,7 +102,8 @@
<select id="getPdfInfo" resultMap="resultPdfInfoMap">
SELECT
*
*,
round(price*settlement,2) as amount
FROM
(
SELECT
@ -131,8 +132,7 @@
) AS `rate`,
ROUND(IFNULL( SUM(d.amount)/SUM( CASE b.unit WHEN 0 THEN b.settlement ELSE b.settlement/1000 END ),0), 6 ) AS `price`,
ROUND( SUM( CASE b.unit WHEN 0 THEN b.settlement ELSE b.settlement/1000 END ), 3 ) AS `settlement`,
( CASE b.unit WHEN 0 THEN '吨' ELSE '千克' END ) AS `unit`,
ROUND( a.amount, 2 ) `amount`
( CASE b.unit WHEN 0 THEN '吨' ELSE '千克' END ) AS `unit`
FROM
jg_purchaseorder AS a
LEFT JOIN jg_purchaseorder_item0 d ON a.id = d.purchaseorder_id
@ -152,7 +152,7 @@
b.unit,
a.document_no
) aaa ${ew.customSqlSegment}
order by aaa.itemName
order by aaa.itemName
</select>
<select id="getOrderInfo" resultMap="resultOrderInfoMap">
@ -294,7 +294,7 @@
e.ticketno ticketNo,
ROUND( c.gross_weight, 2 ) grossWeight,
ROUND( c.tare_weight, 2 ) tareWeight,
ROUND( c.buckle_weight, 2 ) buckleWeight,
ROUND( c.buckle_weight, 3 ) buckleWeight,
ROUND( c.settlement, 3 ) settlement,
ROUND( c.purchase_price, 2 ) purchasePrice,
( CASE c.unit WHEN 0 THEN '吨' ELSE '千克' END ) AS `unit`,

@ -165,7 +165,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="业务员2" prop="naturalId">
<popupSelect disabled v-model="dataForm.naturalId" placeholder="请选择业务员2" clearable field="naturalId"
<popupSelect v-model="dataForm.naturalId" placeholder="请选择业务员2" clearable field="naturalId"
interfaceId="395933800510599301" :columnOptions="naturalIdcolumnOptions" propsValue="id"
relationField="name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage :pageSize="20">
</popupSelect>

@ -70,7 +70,7 @@
</el-tabs>
<el-dialog :title="eventType === 'audit' ? '审批通过' : '审批拒绝'" :close-on-click-modal="false" :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll append-to-body width='600px'>
<el-form label-width="80px" ref="candidateForm" :model="candidateForm">
<el-form label-width="80px" ref="candidateForm" :model="candidateForm" >
<template v-if="eventType === 'audit'">
<el-form-item :label="item.nodeName + item.label" :prop="'candidateList.' + i + '.value'"
v-for="(item, i) in candidateForm.candidateList" :key="i" :rules="item.rules">
@ -81,8 +81,9 @@
<el-form-item label="加签人员" v-if="eventType === 'audit' && properties.hasFreeApprover">
<user-select v-model="handleId" placeholder="请选择加签人员,不选即该节点审核结束" />
</el-form-item>
<el-form-item label="审批意见">
<el-input v-model="reason" placeholder="请输入审批意见(选填)" type="textarea" :rows="4" />
<el-form-item label="审批意见" :required="true">
<el-input v-model="reason" placeholder="请输入审批意见(必填)" type="textarea" :rows="4" />
<el-tag :key="tag" v-for="tag in dynamicTags" closable :disable-transitions="false" @close="handleClose(tag)"
@click="useTag(tag)">
{{ tag }}
@ -92,6 +93,7 @@
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ </el-button>
</el-form-item>
<el-form-item label="审批签名" v-if="properties.hasSign">
<div class="sign-main">
<div class="sign-head">
@ -164,6 +166,11 @@ export default {
components: { recordList, Process, vueEsign, PrintBrowse, Comment, RecordSummary, CandidateForm, CandidateUserSelect },
data() {
return {
reasonRules: {
reason: [
{ required: true, message: '请选择指派节点', trigger: 'blur'}
]
},
userBoxVisible: false,
userBoxTitle: '审批人',
assignVisible: false,
@ -644,47 +651,58 @@ export default {
})
},
handleApproval() {
debugger
this.$refs['candidateForm'].validate((valid) => {
if (valid) {
if (this.properties.hasSign && !this.signImg) {
this.$message({
message: '请签名',
type: 'error'
})
return
}
let query = {
handleOpinion: this.reason,
formData: this.formData,
enCode: this.setting.enCode,
signImg: this.signImg,
copyIds: this.copyIds.join(',')
}
if (this.candidateForm.candidateList.length) {
let candidateList = {}
for (let i = 0; i < this.candidateForm.candidateList.length; i++) {
candidateList[this.candidateForm.candidateList[i].nodeId] = this.candidateForm.candidateList[i].value
}
query.candidateList = candidateList
}
if (this.eventType === 'audit' && this.properties.hasFreeApprover) {
query = { freeApproverUserId: this.handleId, ...query }
}
const approvalMethod = this.eventType === 'audit' ? Audit : Reject
this.approvalBtnLoading = true
approvalMethod(this.setting.taskId, query).then(res => {
this.$message({
type: 'success',
message: res.msg,
duration: 1000,
onClose: () => {
this.approvalBtnLoading = false
this.visible = false
this.$emit('close', true)
if (valid) {
if (this.properties.hasSign && !this.signImg) {
this.$message({
message: '请签名',
type: 'error'
})
return
}
})
}).catch(() => { this.approvalBtnLoading = false })
}
if (!this.reason) {
this.$message({
message: '请输入审批意见',
type: 'error',
duration: 1500
})
return
}
let query = {
handleOpinion: this.reason,
formData: this.formData,
enCode: this.setting.enCode,
signImg: this.signImg,
copyIds: this.copyIds.join(',')
}
if (this.candidateForm.candidateList.length) {
let candidateList = {}
for (let i = 0; i < this.candidateForm.candidateList.length; i++) {
candidateList[this.candidateForm.candidateList[i].nodeId] = this.candidateForm.candidateList[i].value
}
query.candidateList = candidateList
}
if (this.eventType === 'audit' && this.properties.hasFreeApprover) {
query = { freeApproverUserId: this.handleId, ...query }
}
const approvalMethod = this.eventType === 'audit' ? Audit : Reject
this.approvalBtnLoading = true
approvalMethod(this.setting.taskId, query).then(res => {
this.$message({
type: 'success',
message: res.msg,
duration: 1000,
onClose: () => {
this.approvalBtnLoading = false
this.visible = false
this.$emit('close', true)
}
})
}).catch(() => {
this.approvalBtnLoading = false
})
}
})
},
handleReset() {

Loading…
Cancel
Save