Browse Source

完善分公司间调车调账--重复提交

master
yunuo970428 2 years ago
parent
commit
1a36656584
  1. 44
      anrui-scm/anrui-scm-ui/src/views/supplychain/tiaozhangshenqingguanli/tiaozhangshenqingguanliAdd.vue
  2. 6
      anrui-scm/anrui-scm-ui/src/views/supplychain/tiaozhangshenqingguanli/tiaozhangshenqingguanliInfo.vue
  3. 47
      anrui-scm/anrui-scm-ui/src/views/workFlow/tiaozhangshenqingFlow/tiaozhangshenqingEdit.vue

44
anrui-scm/anrui-scm-ui/src/views/supplychain/tiaozhangshenqingguanli/tiaozhangshenqingguanliAdd.vue

@ -17,7 +17,7 @@
<!--标题按钮部分结束--> <!--标题按钮部分结束-->
<!--Start 新增修改部分--> <!--Start 新增修改部分-->
<div class="listconadd"><!-- --> <div class="listconadd"><!-- -->
<div class="title">分公司间调账申请</div> <div class="titwu">分公司间调账申请</div>
<el-form ref="dataForm" :model="temp" :rules="rules" :inline="true" label-width="120px" class="formadd"> <el-form ref="dataForm" :model="temp" :rules="rules" :inline="true" label-width="120px" class="formadd">
<div class="invoiceadd" style="margin-top: 5px;"> <div class="invoiceadd" style="margin-top: 5px;">
<el-row> <el-row>
@ -347,6 +347,7 @@ export default {
this.list = [] this.list = []
this.useOrg = '' this.useOrg = ''
this.useOrgName = '' this.useOrgName = ''
this.submitdisabled = false
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.$emit('doback') this.$emit('doback')
}, },
@ -355,15 +356,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].clearValidate() this.$refs['dataForm'].clearValidate()
}) })
// this.temp.name = window.sessionStorage.getItem('name')
this.temp.createBySid = window.sessionStorage.getItem('userSid') this.temp.createBySid = window.sessionStorage.getItem('userSid')
// req.detailsInfo(this.temp.sid).then(resp => {
// const data = resp.data
// this.temp.applicationCode = data.applicationCode
// this.temp.createTime = data.createTime
// }).catch(e => {
// this.submitdisabled = false
// })
this.dialogStatus = 'add' this.dialogStatus = 'add'
this.viewTitle = '【新增】分公司间调账申请' this.viewTitle = '【新增】分公司间调账申请'
this.getPathSid() this.getPathSid()
@ -376,7 +369,7 @@ export default {
}) })
this.dialogStatus = 'edit' this.dialogStatus = 'edit'
this.viewTitle = '【编辑】分公司间调账申请' this.viewTitle = '【编辑】分公司间调账申请'
fetchDetailsBySid(row.sid).then(resp => { fetchDetailsBySid(row.sid).then((resp) => {
if (resp.success) { if (resp.success) {
const data = resp.data const data = resp.data
this.temp = data this.temp = data
@ -385,8 +378,6 @@ export default {
this.temp.accSids = [] this.temp.accSids = []
console.log('编辑初始化', this.temp) console.log('编辑初始化', this.temp)
} }
}).catch(e => {
this.submitdisabled = false
}) })
this.getPathSid() this.getPathSid()
this.getType() this.getType()
@ -400,8 +391,7 @@ export default {
this.list.forEach(element => { this.list.forEach(element => {
this.temp.accSids.push(element.sid) this.temp.accSids.push(element.sid)
}) })
save(this.temp).then(resp => { save(this.temp).then((resp) => {
this.submitdisabled = false
if (resp.success) { if (resp.success) {
if (resp.success) { if (resp.success) {
_this.handleReturn('true') _this.handleReturn('true')
@ -423,26 +413,6 @@ export default {
} }
}) })
}, },
// saveEdit() {
// const _this = this
// this.$refs['dataForm'].validate(valid => {
// if (valid) {
// this.submitdisabled = true
// req.save(this.temp).then(resp => {
// this.submitdisabled = false
// if (resp.success) {
// if (resp.success) {
// _this.handleReturn('true')
// }
// }
// }).catch(() => {
// this.submitdisabled = false
// })
// } else {
// return false
// }
// })
// },
handleSubmit() { handleSubmit() {
const _this = this const _this = this
this.$refs['dataForm'].validate(valid => { this.$refs['dataForm'].validate(valid => {
@ -458,8 +428,7 @@ export default {
}).then(() => { }).then(() => {
this.submitdisabled = true this.submitdisabled = true
this.temp.detailsList = this.list this.temp.detailsList = this.list
submitAccAdjApply(this.temp).then(resp => { submitAccAdjApply(this.temp).then((resp) => {
this.submitdisabled = false
if (resp.success) { if (resp.success) {
if (resp.success) { if (resp.success) {
_this.handleReturn('true') _this.handleReturn('true')
@ -487,9 +456,6 @@ export default {
</script> </script>
<style scoped> <style scoped>
.title {
padding: 28px 0;
}
.formadd /deep/ .el-row { .formadd /deep/ .el-row {
border: 0; border: 0;

6
anrui-scm/anrui-scm-ui/src/views/supplychain/tiaozhangshenqingguanli/tiaozhangshenqingguanliInfo.vue

@ -15,7 +15,7 @@
<!--标题按钮部分结束--> <!--标题按钮部分结束-->
<!--Start 新增修改部分--> <!--Start 新增修改部分-->
<div class="listconadd"><!-- --> <div class="listconadd"><!-- -->
<div class="title">分公司间调账申请</div> <div class="titwu">分公司间调账申请</div>
<el-form ref="dataForm" :model="temp" :rules="rules" :inline="true" label-width="120px" class="formadd"> <el-form ref="dataForm" :model="temp" :rules="rules" :inline="true" label-width="120px" class="formadd">
<div class="invoiceadd" style="margin-top: 5px;"> <div class="invoiceadd" style="margin-top: 5px;">
<el-row> <el-row>
@ -169,10 +169,6 @@ export default {
</script> </script>
<style scoped> <style scoped>
.title {
padding: 28px 0;
}
.formadd /deep/ .el-row { .formadd /deep/ .el-row {
border: 0; border: 0;
} }

47
anrui-scm/anrui-scm-ui/src/views/workFlow/tiaozhangshenqingFlow/tiaozhangshenqingEdit.vue

@ -7,12 +7,7 @@
<div>编辑分公司间调账申请</div> <div>编辑分公司间调账申请</div>
<!--start 添加修改按钮--> <!--start 添加修改按钮-->
<div> <div>
<el-button <el-button type="primary" size="small" :disabled="submitdisabled" @click="handleCreate()">保存
type="primary"
size="small"
:disabled="submitdisabled"
@click="handleCreate()"
>保存
</el-button> </el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSubmit()">提交 <el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSubmit()">提交
</el-button> </el-button>
@ -366,23 +361,20 @@ export default {
handleCreate() { handleCreate() {
this.$refs['dataForm'].validate(valid => { this.$refs['dataForm'].validate(valid => {
if (valid) { if (valid) {
this.submitdisabled = true
if (this.list.length > 0) { if (this.list.length > 0) {
this.submitdisabled = true
this.list.forEach(element => { this.list.forEach(element => {
this.temp.accSids.push(element.sid) this.temp.accSids.push(element.sid)
}) })
save(this.temp).then(resp => { save(this.temp).then((resp) => {
this.submitdisabled = false
if (resp.success) { if (resp.success) {
if (resp.success) { window.parent.postMessage({
window.parent.postMessage({ cmd: 'returnHeight',
cmd: 'returnHeight', params: {
params: { //
// code: 1
code: 1 }
} }, '*')
}, '*')
}
} }
}).catch(() => { }).catch(() => {
this.submitdisabled = false this.submitdisabled = false
@ -414,18 +406,15 @@ export default {
}) })
this.submitdisabled = true this.submitdisabled = true
this.temp.detailsList = this.list this.temp.detailsList = this.list
submitAccAdjApply(this.temp).then(resp => { submitAccAdjApply(this.temp).then((resp) => {
this.submitdisabled = false
if (resp.success) { if (resp.success) {
if (resp.success) { window.parent.postMessage({
window.parent.postMessage({ cmd: 'returnHeight',
cmd: 'returnHeight', params: {
params: { //
// code: 1
code: 1 }
} }, '*')
}, '*')
}
} }
}).catch(() => { }).catch(() => {
this.submitdisabled = false this.submitdisabled = false

Loading…
Cancel
Save