|
@@ -1,25 +1,27 @@
|
|
|
<template>
|
|
|
<m-dialog title="新增测算" ref="dialog" v-bind="$attrs" width="1200px" v-on="$listeners">
|
|
|
<template #button-after>
|
|
|
- <m-button :disabled="active === 0" @click="onPrev">上一步</m-button>
|
|
|
- <m-button v-if="active === items.length - 1" type="success" @click="onIssue">发布</m-button>
|
|
|
- <m-button v-else type="orange" @click="onNext">下一步</m-button>
|
|
|
+ <m-button :disabled="active === 0 || loading" @click="onPrev">上一步</m-button>
|
|
|
+ <m-button v-if="active === items.length - 1" type="success" @click="onIssue" :disabled="loading">发布</m-button>
|
|
|
+ <m-button v-else type="orange" @click="onNext" :disabled="loading">下一步</m-button>
|
|
|
</template>
|
|
|
- <div style="min-height: 100px;">
|
|
|
- <el-steps :active="active" finish-status="success">
|
|
|
- <el-step
|
|
|
- v-for="item in items"
|
|
|
- :key="item.title"
|
|
|
- :title="item.title"
|
|
|
- :description="item.description ? item.subtitle + item.description : ''"
|
|
|
- ></el-step>
|
|
|
- </el-steps>
|
|
|
+ <div v-loading="loading">
|
|
|
+ <div style="min-height: 100px;">
|
|
|
+ <el-steps :active="active" finish-status="success">
|
|
|
+ <el-step
|
|
|
+ v-for="item in items"
|
|
|
+ :key="item.title"
|
|
|
+ :title="item.title"
|
|
|
+ :description="item.description ? item.subtitle + item.description : ''"
|
|
|
+ ></el-step>
|
|
|
+ </el-steps>
|
|
|
+ </div>
|
|
|
+ <SandboxRules v-show="active === 0" ref="sandboxRulesRefs" @row-click="assignDescription"></SandboxRules>
|
|
|
+ <SandboxList v-show="active === 1" ref="sandboxListRefs" @row-click="assignDescription"></SandboxList>
|
|
|
+ <SandboxParam v-show="active === 2" ref="sandboxParamRefs"></SandboxParam>
|
|
|
+ <SandboxDate v-show="active === 3" ref="sandboxDateRefs" @change="assignDescription"></SandboxDate>
|
|
|
+ <SandboxResultDetails v-show="active === 4" ref="sandboxResultDetailsRefs"></SandboxResultDetails>
|
|
|
</div>
|
|
|
- <SandboxRules v-show="active === 0" ref="sandboxRulesRefs" @row-click="assignDescription"></SandboxRules>
|
|
|
- <SandboxList v-show="active === 1" ref="sandboxListRefs" @row-click="assignDescription"></SandboxList>
|
|
|
- <SandboxParam v-show="active === 2" ref="sandboxParamRefs"></SandboxParam>
|
|
|
- <SandboxDate v-show="active === 3" ref="sandboxDateRefs" @change="assignDescription"></SandboxDate>
|
|
|
- <SandboxResultDetails v-show="active === 4" ref="sandboxResultDetailsRefs"></SandboxResultDetails>
|
|
|
</m-dialog>
|
|
|
</template>
|
|
|
|
|
@@ -70,6 +72,7 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
active: 0,
|
|
|
descriptionValues: JSON.parse(JSON.stringify(_data))
|
|
|
}
|
|
@@ -106,7 +109,7 @@ export default {
|
|
|
}
|
|
|
this.active--
|
|
|
},
|
|
|
- onNext () {
|
|
|
+ async onNext () {
|
|
|
if (this.active === this.items.length - 1) {
|
|
|
return
|
|
|
}
|
|
@@ -116,14 +119,25 @@ export default {
|
|
|
if (this.active === 2) {
|
|
|
this.descriptionValues[this.active].name = '完成系数设置'
|
|
|
}
|
|
|
+
|
|
|
+ if (this.active === 3) {
|
|
|
+ // 开始计算 调用保存接口
|
|
|
+ this.loading = true
|
|
|
+ const success = await this.$refs.sandboxParamRefs.onSave()
|
|
|
+ this.loading = false
|
|
|
+ if (!success) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
this.active++
|
|
|
this.ref.init && this.ref.init(this.descriptionValues[this.active - 1].id)
|
|
|
},
|
|
|
async onIssue () {
|
|
|
this.loading = true
|
|
|
try {
|
|
|
- await sendSalaryRelease({ performanceSolutionId: this.descriptionValues[4].id })
|
|
|
+ await sendSalaryRelease({ performanceSolutionId: this.descriptionValues[1].id })
|
|
|
this.$message.success('发布成功')
|
|
|
+ this.$refs.dialog.close()
|
|
|
} catch (error) {
|
|
|
this.$message.error(error)
|
|
|
} finally {
|