This commit is contained in:
yanran200730
2023-04-07 11:50:26 +08:00
2 changed files with 127 additions and 153 deletions

View File

@@ -69,7 +69,6 @@ export default {
] ]
}, },
detailTitle: v => v.detailObj?.id ? "编辑事项" : "添加事项", detailTitle: v => v.detailObj?.id ? "编辑事项" : "添加事项",
processType: v => v.$route.hash == "#add" ? 0 : 2
}, },
methods: { methods: {
...mapActions(['closePage']), ...mapActions(['closePage']),
@@ -119,7 +118,6 @@ export default {
*/ */
save() { save() {
this.$refs['processApproval'].handleProcessApproval().then(res => { this.$refs['processApproval'].handleProcessApproval().then(res => {
const {processType} = this
this.instance.post(`/app/approval-process-def/add-update`, { this.instance.post(`/app/approval-process-def/add-update`, {
...this.detailObj, ...this.detailObj,
...this.baseInfo, ...this.baseInfo,
@@ -131,7 +129,7 @@ export default {
tableType: 0, tableType: 0,
processAnnexDefs: this.annexs.map(e => ({...e, mustFill: Number(e.mustFill)})), processAnnexDefs: this.annexs.map(e => ({...e, mustFill: Number(e.mustFill)})),
processNodeList: res.processNodeList, processNodeList: res.processNodeList,
processType processType: 0
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success("保存成功") this.$message.success("保存成功")
@@ -144,7 +142,7 @@ export default {
}, },
getDetail() { getDetail() {
const {id} = this.$route.query const {id} = this.$route.query
this.instance.post(`/app/approval-process-def/info-id`, null, {params: {id}}).then(res => { id && this.instance.post(`/app/approval-process-def/info-id`, null, {params: {id}}).then(res => {
if (res?.data) { if (res?.data) {
this.detailObj = res.data this.detailObj = res.data
this.filedList = res.data.tableInfo.tableFieldInfos this.filedList = res.data.tableInfo.tableFieldInfos

View File

@@ -24,14 +24,8 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属分类" prop="classificationId"> <el-form-item label="所属分类" prop="classificationId">
<el-select placeholder="请选择" size="small" v-model="form.classificationId" clearable <ai-select v-model="form.classificationId" :instance="instance" action="/app/zwspapprovalclassification/list?status=1"
style="width: 100%;"> :prop="{label:'name'}"/>
<el-option
v-for="(item,i) in classList" :key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -58,14 +52,13 @@
</template> </template>
<script> <script>
import {mapMutations} from "vuex";
export default { export default {
name: "addConfig", name: "guidance",
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
row: Object,
processType: String
}, },
data() { data() {
return { return {
@@ -76,7 +69,6 @@
needToKnow: "", needToKnow: "",
processDefStatus: "1", processDefStatus: "1",
}, },
classList: [],
} }
}, },
computed: { computed: {
@@ -89,27 +81,13 @@
processDefStatus: [{required: true, message: '请选择是否启用', trigger: 'change'}], processDefStatus: [{required: true, message: '请选择是否启用', trigger: 'change'}],
} }
}, },
detailTitle() { detailTitle: v => v.detailObj?.id ? "编辑办事指南" : "添加办事指南",
return this.row?.id ? "编辑办事指南" : "添加办事指南"
}
}, },
methods: { methods: {
...mapMutations(['setPageTitle']),
/** /**
* 获取分类 * 获取分类
*/ */
getClassification() {
this.instance.post(`/app/zwspapprovalclassification/list`, null, {
params: {
current: 1,
status: 1,
size: 9999
}
}).then(res => {
if (res?.data) {
this.classList = res.data.records
}
})
},
/** /**
* 保存 * 保存
*/ */
@@ -118,8 +96,7 @@
if (valid) { if (valid) {
this.instance.post(`/app/approval-process-def/add-update`, { this.instance.post(`/app/approval-process-def/add-update`, {
...this.form, ...this.form,
id: this.row.id, processType: 2
processType: this.processType
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success("保存成功") this.$message.success("保存成功")
@@ -129,8 +106,9 @@
} }
}) })
}, },
getDetail(id) { getDetail() {
this.instance.post(`/app/approval-process-def/info-id`, null, {params: {id}}).then(res => { const {id} = this.$route.query
id && this.instance.post(`/app/approval-process-def/info-id`, null, {params: {id}}).then(res => {
if (res?.data) { if (res?.data) {
Object.keys(this.form).map(e => this.form[e] = res.data[e]) Object.keys(this.form).map(e => this.form[e] = res.data[e])
} }
@@ -141,16 +119,14 @@
} }
}, },
created() { created() {
this.getClassification() this.setPageTitle(this.detailTitle)
if (this.row?.id) { this.getDetail()
this.getDetail(this.row?.id)
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.add-config { .guidance {
height: 100%; height: 100%;
.step { .step {