|
|
@@ -8,9 +8,10 @@
|
|
|
direction="rtl"
|
|
|
size="90%"
|
|
|
append-to-body
|
|
|
+ v-if="status"
|
|
|
@close="onClose">
|
|
|
<div class="detail__panel">
|
|
|
- <div class="container sticky">
|
|
|
+ <div class="container normal-panel sticky">
|
|
|
<!-- <el-button v-show="save" type="warning" size="small" @click="onSubmit()" >保 存</el-button>-->
|
|
|
<el-button class="inline-16" v-if="tool.checkAuth($route.name,'update')" :disabled="form.status == '发布'" type="primary" size="small" @click="onEdit()" >编 辑</el-button>
|
|
|
<release class="inline-16" v-if="edit" :data="form" @onSuccess="onSuccess"></release>
|
|
|
@@ -79,7 +80,7 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="11" :onlyread="store.state.pageOnlyRead">
|
|
|
- <scopeOfauth :defaultData="defaultData" :disabled="form.status == '发布'" appidname="sat_submiteditmodelid" obiectName="sat_submiteditmodel" :dataid="$route.query.id"
|
|
|
+ <scopeOfauth v-if="defaultData" :defaultData="defaultData" :disabled="!save" appidname="sat_submiteditmodelid" obiectName="sat_submiteditmodel" :dataid="$route.query.id"
|
|
|
@onChecked="onChecked"></scopeOfauth>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -141,13 +142,21 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ authData: {
|
|
|
+ departmentid: [],
|
|
|
+ hrid: [],
|
|
|
+ isonlymanager_agent: false,
|
|
|
+ isonlymanager_dept: false,
|
|
|
+ sa_agentsid: [],
|
|
|
+ sat_submiteditmodelid: '',
|
|
|
+ },
|
|
|
store,
|
|
|
drawer:false,
|
|
|
edit:true,
|
|
|
save:false,
|
|
|
status:false,
|
|
|
folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
|
|
|
- defaultData: {},
|
|
|
+ defaultData: '',
|
|
|
rules: {
|
|
|
title: [
|
|
|
{ required: true, message: '请输入课程名称', trigger: 'blur' },
|
|
|
@@ -177,6 +186,21 @@ export default {
|
|
|
"begdate": "",
|
|
|
"enddate": "",
|
|
|
"type": []
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ drawer (val) {
|
|
|
+ if(!val) {
|
|
|
+ this.save =false
|
|
|
+ this.edit = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ edit (val) {
|
|
|
+ if(val) {
|
|
|
+ this.$store.dispatch('pageOnlyRead',true)
|
|
|
+ } else {
|
|
|
+ this.$store.dispatch('pageOnlyRead',false)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -196,6 +220,13 @@ export default {
|
|
|
if (this.form.istextrequired === 1) { this.form.type.push('文字提报') }
|
|
|
|
|
|
this.form.status !== '新建' ? store.state.pageOnlyRead = true : store.state.pageOnlyRead = false
|
|
|
+
|
|
|
+ if(!this.save) {
|
|
|
+ this.$store.dispatch('pageOnlyRead',true)
|
|
|
+ } else {
|
|
|
+ this.$store.dispatch('pageOnlyRead',false)
|
|
|
+ }
|
|
|
+
|
|
|
this.status = true
|
|
|
},
|
|
|
onSubmit() {
|
|
|
@@ -205,7 +236,8 @@ export default {
|
|
|
"id":20221102093702,
|
|
|
"content": this.form
|
|
|
})
|
|
|
- this.insertCoursewareauth()
|
|
|
+ this.edit = true
|
|
|
+ this.insertCoursewareauth(res.data)
|
|
|
this.drawer = false
|
|
|
this.$emit("updateSuccess")
|
|
|
})
|
|
|
@@ -221,7 +253,12 @@ export default {
|
|
|
console.log(this.authData)
|
|
|
},
|
|
|
// 新增授权范围
|
|
|
- async insertCoursewareauth() {
|
|
|
+ async insertCoursewareauth(data) {
|
|
|
+ this.authData.sat_submiteditmodelid = data.sat_submiteditmodelid
|
|
|
+ if (this.authData.departmentid.length == 0) this.authData.departmentid = this.defaultData.departmentid
|
|
|
+ if (this.authData.hrid.length == 0) this.authData.hrid = this.defaultData.hrid
|
|
|
+ if (this.authData.sa_agentsid.length == 0) this.authData.sa_agentsid = this.defaultData.sa_agentsid
|
|
|
+ if (this.authData.sa_saleareaid.length == 0) this.authData.sa_saleareaid = this.defaultData.sa_saleareaid.departmentid
|
|
|
const res = await this.$api.requested({
|
|
|
"id":"20221102094302",
|
|
|
"content": this.authData
|
|
|
@@ -242,6 +279,8 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.defaultData = res.data
|
|
|
+ console.log(this.defaultData);
|
|
|
+
|
|
|
},
|
|
|
onshow(){
|
|
|
this.$router.replace({path:'submit_mag',query:{id:this.id}})
|