Browse Source

完善未售买断

master
yunuo970428 1 year ago
parent
commit
0f165f9248
  1. 53
      anrui-scm/anrui-scm-ui/src/views/weishoumaiduan/weishoumaiduanguanli/unsoldAdd.vue
  2. 53
      anrui-scm/anrui-scm-ui/src/views/workFlow/weishoumaiduanFlow/weishoumaiduanguanli/weushoumaiduanEdit.vue

53
anrui-scm/anrui-scm-ui/src/views/weishoumaiduan/weishoumaiduanguanli/unsoldAdd.vue

@ -189,7 +189,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="payAccount" label="付款金额(元)" align="center"> <el-table-column prop="payAccount" label="付款金额(元)" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.payAccount" placeholder="" clearable @keyup.native="UpNumberOne($event, scope.row)" @keydown.native="UpNumberOne($event, scope.row)"></el-input> <el-input v-model="scope.row.payAccount" placeholder="" clearable @keyup.native="scope.row.payAccount = UpNumberOne(scope.row.payAccount, 2, scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="付款备注" align="center"> <el-table-column label="付款备注" align="center">
@ -308,15 +308,24 @@ export default {
} }
row.actualMoney = e.target.value row.actualMoney = e.target.value
}, },
UpNumberOne(e, row) { UpNumberOne(val, limit, row) {
e.target.value = e.target.value.replace(/[^\d]/g, '') // ."-" val = val.replace(/[^0-9.]/g, '') //
e.target.value = e.target.value.replace(/^00/, '0') // 0 val = val.replace(/^00/, '0.') // 0
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { val = val.replace(/^\./g, '0.') // 0.
// 0102 val = val.replace(/\.{2,}/g, '.') //
console.log(e.target.value) val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //
e.target.value = parseFloat(e.target.value) /^0\d+/.test(val) ? val = val.slice(1) : '' // 0
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
const reg = new RegExp(str)
if (limit === 0) {
//
val = val.replace(reg, '$1')
} else {
//
val = val.replace(reg, '$1.$2')
} }
row.payAccount = e.target.value row.payAccount = val
return row.payAccount
}, },
// //
addCommodity() { addCommodity() {
@ -457,6 +466,19 @@ export default {
save() { save() {
this.$refs['form_obj'].validate((valid) => { this.$refs['form_obj'].validate((valid) => {
if (valid) { if (valid) {
if (this.formobj.isPay === '1') {
if (this.formobj.detailsPayList.length > 0) {
for (var i = 0; i < this.formobj.detailsPayList.length; i++) {
if (this.formobj.detailsPayList[i].payAccount === '') {
this.$message({ showClose: true, type: 'error', message: '付款明细列表中付款金额不能为空' })
return
}
}
} else {
this.$message({ showClose: true, type: 'error', message: '付款明细列表不能为空' })
return
}
}
this.submitdisabled = true this.submitdisabled = true
req.saveOrUpdate(this.formobj).then((resp) => { req.saveOrUpdate(this.formobj).then((resp) => {
if (resp.success) { if (resp.success) {
@ -476,6 +498,19 @@ export default {
submitVehicleApply() { submitVehicleApply() {
this.$refs['form_obj'].validate((valid) => { this.$refs['form_obj'].validate((valid) => {
if (valid) { if (valid) {
if (this.formobj.isPay === '1') {
if (this.formobj.detailsPayList.length > 0) {
for (var i = 0; i < this.formobj.detailsPayList.length; i++) {
if (this.formobj.detailsPayList[i].payAccount === '') {
this.$message({ showClose: true, type: 'error', message: '付款明细列表中付款金额不能为空' })
return
}
}
} else {
this.$message({ showClose: true, type: 'error', message: '付款明细列表不能为空' })
return
}
}
this.submitdisabled = true this.submitdisabled = true
req.submitVehicleApply(this.formobj).then((res) => { req.submitVehicleApply(this.formobj).then((res) => {
if (res.success) { if (res.success) {

53
anrui-scm/anrui-scm-ui/src/views/workFlow/weishoumaiduanFlow/weishoumaiduanguanli/weushoumaiduanEdit.vue

@ -188,7 +188,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="payAccount" label="付款金额(元)" align="center"> <el-table-column prop="payAccount" label="付款金额(元)" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.payAccount" placeholder="" clearable @keyup.native="UpNumberOne($event, scope.row)" @keydown.native="UpNumberOne($event, scope.row)"></el-input> <el-input v-model="scope.row.payAccount" placeholder="" clearable @keyup.native="scope.row.payAccount = UpNumberOne(scope.row.payAccount, 2, scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="付款备注" align="center"> <el-table-column label="付款备注" align="center">
@ -290,15 +290,24 @@ export default {
} }
row.actualMoney = e.target.value row.actualMoney = e.target.value
}, },
UpNumberOne(e, row) { UpNumberOne(val, limit, row) {
e.target.value = e.target.value.replace(/[^\d]/g, '') // ."-" val = val.replace(/[^0-9.]/g, '') //
e.target.value = e.target.value.replace(/^00/, '0') // 0 val = val.replace(/^00/, '0.') // 0
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { val = val.replace(/^\./g, '0.') // 0.
// 0102 val = val.replace(/\.{2,}/g, '.') //
console.log(e.target.value) val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); //
e.target.value = parseFloat(e.target.value) /^0\d+/.test(val) ? val = val.slice(1) : '' // 0
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
const reg = new RegExp(str)
if (limit === 0) {
//
val = val.replace(reg, '$1')
} else {
//
val = val.replace(reg, '$1.$2')
} }
row.payAccount = e.target.value row.payAccount = val
return row.payAccount
}, },
// //
addCommodity() { addCommodity() {
@ -449,6 +458,19 @@ export default {
save() { save() {
this.$refs['form_obj'].validate((valid) => { this.$refs['form_obj'].validate((valid) => {
if (valid) { if (valid) {
if (this.formobj.isPay === '1') {
if (this.formobj.detailsPayList.length > 0) {
for (var i = 0; i < this.formobj.detailsPayList.length; i++) {
if (this.formobj.detailsPayList[i].payAccount === '') {
this.$message({ showClose: true, type: 'error', message: '付款明细列表中付款金额不能为空' })
return
}
}
} else {
this.$message({ showClose: true, type: 'error', message: '付款明细列表不能为空' })
return
}
}
this.submitdisabled = true this.submitdisabled = true
req.saveOrUpdate(this.formobj).then((resp) => { req.saveOrUpdate(this.formobj).then((resp) => {
if (resp.success) { if (resp.success) {
@ -480,6 +502,19 @@ export default {
submitVehicleApply() { submitVehicleApply() {
this.$refs['form_obj'].validate((valid) => { this.$refs['form_obj'].validate((valid) => {
if (valid) { if (valid) {
if (this.formobj.isPay === '1') {
if (this.formobj.detailsPayList.length > 0) {
for (var i = 0; i < this.formobj.detailsPayList.length; i++) {
if (this.formobj.detailsPayList[i].payAccount === '') {
this.$message({ showClose: true, type: 'error', message: '付款明细列表中付款金额不能为空' })
return
}
}
} else {
this.$message({ showClose: true, type: 'error', message: '付款明细列表不能为空' })
return
}
}
this.submitdisabled = true this.submitdisabled = true
req.submitVehicleApply(this.formobj).then((res) => { req.submitVehicleApply(this.formobj).then((res) => {
if (res.success) { if (res.success) {

Loading…
Cancel
Save