|
|
|
@ -1,62 +1,48 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<el-dialog title="计算" append-to-body :modelValue="openShow" width="30%" @close="closeDialog"> |
|
|
|
<el-dialog title="计算" append-to-body :modelValue="openShow" width="30%" @close="closeDialog"> |
|
|
|
<avue-form :option="option" v-model="form"></avue-form> |
|
|
|
|
|
|
|
<template #footer> |
|
|
|
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button @click="closeDialog">取 消</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" @click="submit">确 定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<div v-if="calculationIn" class="box"> |
|
|
|
<div v-if="calculationIn" class="box"> |
|
|
|
<div v-loading="isLoading" style="height:100px"></div> |
|
|
|
<div v-loading="isLoading" style="height:100px"></div> |
|
|
|
<h3>计算中</h3> |
|
|
|
<h3>计算中</h3> |
|
|
|
<div>正在计算(80/100),请勿关闭</div> |
|
|
|
<div>正在计算(80/100),请勿关闭</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="!calculationIn" class="box"> |
|
|
|
<div v-if="!calculationIn"> |
|
|
|
|
|
|
|
<div class="box"> |
|
|
|
<el-icon style="font-size: 48px;"> |
|
|
|
<el-icon style="font-size: 48px;"> |
|
|
|
<DocumentChecked /> |
|
|
|
<DocumentChecked /> |
|
|
|
</el-icon> |
|
|
|
</el-icon> |
|
|
|
<h3>计算完成</h3> |
|
|
|
<h3>计算完成</h3> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="!calculationIn"> |
|
|
|
<div> |
|
|
|
<h4>计算结果</h4> |
|
|
|
<h4>计算结果</h4> |
|
|
|
<div class="box-txt"> |
|
|
|
<div class="box-txt"> |
|
|
|
<el-icon style="color:#67c23a;margin-right: 4px;margin-top: 2px;"> |
|
|
|
<el-icon style="color:#67c23a;margin-right: 4px;margin-top: 2px;"> |
|
|
|
<SuccessFilled /> |
|
|
|
<SuccessFilled /> |
|
|
|
</el-icon>结算成功{{ result.successCount }}条,<i style="color: blue;">待审核></i> |
|
|
|
</el-icon>结算成功{{ successCount }}条 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="box-txt"> |
|
|
|
<div class="box-txt"> |
|
|
|
<el-icon style="color:#f56c6c;margin-right: 4px;margin-top: 2px;"> |
|
|
|
<el-icon style="color:#f56c6c;margin-right: 4px;margin-top: 2px;"> |
|
|
|
<CircleCloseFilled /> |
|
|
|
<CircleCloseFilled /> |
|
|
|
</el-icon>结算异常{{ result.exceptionCount }}条,<i style="color: blue;">待审核></i> |
|
|
|
</el-icon>结算异常{{ exceptionCount }}条 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<template #footer> |
|
|
|
<!-- <template #footer> |
|
|
|
|
|
|
|
<span class="dialog-footer"> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button @click="closeDialog">取 消</el-button> |
|
|
|
<el-button @click="closeDialog">关 闭</el-button> |
|
|
|
<el-button type="primary" @click="submit">确 定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</template> --> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import {oemSettleAccountsItem,preSettlementItem} from "@/api/outsourcingManagement/oemOrderSettlement" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
showDialog: { |
|
|
|
showDialog: { |
|
|
|
type: Boolean, |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
default: false |
|
|
|
}, |
|
|
|
}, |
|
|
|
type: { |
|
|
|
settleResult: { |
|
|
|
type: String, |
|
|
|
type: Object, |
|
|
|
default: 'settle' |
|
|
|
default: null |
|
|
|
}, |
|
|
|
|
|
|
|
statementList: { |
|
|
|
|
|
|
|
type: Array, |
|
|
|
|
|
|
|
default: () => [] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
@ -64,91 +50,32 @@ export default { |
|
|
|
isLoading: true, |
|
|
|
isLoading: true, |
|
|
|
openShow: false, |
|
|
|
openShow: false, |
|
|
|
calculationIn: true, |
|
|
|
calculationIn: true, |
|
|
|
form: {}, |
|
|
|
|
|
|
|
result: { |
|
|
|
|
|
|
|
successCount: 0, |
|
|
|
successCount: 0, |
|
|
|
exceptionCount: 0 |
|
|
|
exceptionCount: 0 |
|
|
|
}, |
|
|
|
|
|
|
|
option: { |
|
|
|
|
|
|
|
submitBtn: false, |
|
|
|
|
|
|
|
emptyBtn: false, |
|
|
|
|
|
|
|
column: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '镀后入库时间', |
|
|
|
|
|
|
|
prop: 'putStoreDate', |
|
|
|
|
|
|
|
span: 24, |
|
|
|
|
|
|
|
type: "date", |
|
|
|
|
|
|
|
format: 'YYYY-MM-DD', |
|
|
|
|
|
|
|
valueFormat: 'YYYY-MM-DD', |
|
|
|
|
|
|
|
placeholder: '请选择镀后入库时间', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rules: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请选择镀后入库时间", |
|
|
|
|
|
|
|
trigger: "change" |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '现执行价格', |
|
|
|
|
|
|
|
prop: 'price', |
|
|
|
|
|
|
|
type: 'number', |
|
|
|
|
|
|
|
span: 24, |
|
|
|
|
|
|
|
placeholder: '请输入现执行价格', |
|
|
|
|
|
|
|
min: 0, |
|
|
|
|
|
|
|
precision: 2, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
] |
|
|
|
showDialog(val) { |
|
|
|
} |
|
|
|
this.openShow = val; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.openShow = this.showDialog |
|
|
|
this.openShow = this.showDialog |
|
|
|
|
|
|
|
// 如果有结算结果数据,显示结果 |
|
|
|
|
|
|
|
if (this.settleResult) { |
|
|
|
|
|
|
|
this.calculationIn = true; |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
this.calculationIn = false |
|
|
|
this.calculationIn = false; |
|
|
|
}, 2000) |
|
|
|
this.successCount = this.settleResult.success || 0; |
|
|
|
|
|
|
|
this.exceptionCount = this.settleResult.error || 0; |
|
|
|
|
|
|
|
}, 2000); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
closeDialog() { |
|
|
|
closeDialog() { |
|
|
|
this.openShow = false |
|
|
|
this.openShow = false |
|
|
|
this.$emit('closeDialog'); |
|
|
|
this.$emit('closeDialog'); |
|
|
|
this.$emit('refresh'); |
|
|
|
this.$emit('refresh'); |
|
|
|
}, |
|
|
|
|
|
|
|
submit() { |
|
|
|
|
|
|
|
// 验证表单数据 |
|
|
|
|
|
|
|
if (!this.form.putStoreDate) { |
|
|
|
|
|
|
|
this.$message.warning('请选择镀后入库时间'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!this.form.price) { |
|
|
|
|
|
|
|
this.$message.warning('请输入现执行价格'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const params = { |
|
|
|
|
|
|
|
putStoreDate: this.form.putStoreDate, |
|
|
|
|
|
|
|
price: this.form.price, |
|
|
|
|
|
|
|
statementList: this.statementList |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const requestFn = this.type === 'pre' ? preSettlementItem : oemSettleAccountsItem; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requestFn(params).then(res => { |
|
|
|
|
|
|
|
this.$message.success(this.type === 'pre' ? '预结算成功' : '结算成功'); |
|
|
|
|
|
|
|
// 获取返回的数据并填入计算结果 |
|
|
|
|
|
|
|
if (res.data) { |
|
|
|
|
|
|
|
console.log(res.data.data,'resqqqqqqqqqqqq'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.result.successCount = res.data.data.success || 0; |
|
|
|
|
|
|
|
this.result.exceptionCount = res.data.data.error || 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// this.closeDialog(); |
|
|
|
|
|
|
|
// this.$emit('refresh'); |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
this.$message.error(this.type === 'pre' ? '预结算失败' : '结算失败'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|