|
@@ -322,23 +322,7 @@ export default {
|
|
|
this.pkId = ''
|
|
|
this.knowledgeForm.createBy = this.$store.state.appSetting.user.userId
|
|
|
this.knowledgeForm.author = this.$store.state.appSetting.user.fullName
|
|
|
- let queryParam = {
|
|
|
- "pageNo": 1,
|
|
|
- "pageSize": 1000,
|
|
|
- "sortField": "",
|
|
|
- "sortOrder": "asc",
|
|
|
- "params": {}
|
|
|
- }
|
|
|
- api.findAllApprovalNodes(queryParam).then(res => {
|
|
|
- this.approverData = res.result.data.map(item => {
|
|
|
- return {
|
|
|
- name: item.name,
|
|
|
- approverId: item.approverId,
|
|
|
- approverName: item.approverName,
|
|
|
- isFinal: item.isFinal
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ this.getApprover()
|
|
|
}
|
|
|
this.init()
|
|
|
var token = Vue.ls.get(ACCESS_TOKEN);
|
|
@@ -429,40 +413,49 @@ export default {
|
|
|
},
|
|
|
// 提交数据
|
|
|
handleSaveClick(type) {
|
|
|
- let that = this
|
|
|
- this.$refs.knowledgeRef.validate(valid => {
|
|
|
- if (valid) {
|
|
|
+ if(type==0){
|
|
|
+ this.knowledgeForm.isDraft = type
|
|
|
+ this.saveData()
|
|
|
+ }else{
|
|
|
+ this.$refs.knowledgeRef.validate(valid => {
|
|
|
this.knowledgeForm.isDraft = type
|
|
|
- // 新增
|
|
|
- if(!this.pkId) {
|
|
|
- if(this.isSubmit){
|
|
|
- return false
|
|
|
- }
|
|
|
- this.isSubmit = true
|
|
|
- api.create({...this.knowledgeForm, categoryId: this.knowledgeForm.categoryId.slice(-1)[0]}).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
- if(res.message.indexOf('知识失败')>-1){
|
|
|
- this.$message.error(res.message);
|
|
|
- this.isSubmit = false
|
|
|
- }else{
|
|
|
- setTimeout(function(){
|
|
|
- that.$router.back();
|
|
|
- that.isSubmit = false;
|
|
|
- },2000)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- api.save({...this.knowledgeForm, categoryId: this.knowledgeForm.categoryId.slice(-1)[0], pkId: this.pkId}).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
- setTimeout(() =>
|
|
|
- this.$router.back()
|
|
|
- ,2000)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (valid) {
|
|
|
+ this.saveData()
|
|
|
}
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ saveData(){
|
|
|
+ let that = this
|
|
|
+ // 新增
|
|
|
+ if(!this.pkId) {
|
|
|
+ if(this.isSubmit){
|
|
|
+ return false
|
|
|
}
|
|
|
+ this.isSubmit = true
|
|
|
+ api.create({...this.knowledgeForm, categoryId: this.knowledgeForm.categoryId.slice(-1)[0]}).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ if(res.message.indexOf('知识失败')>-1){
|
|
|
+ this.$message.error(res.message);
|
|
|
+ this.isSubmit = false
|
|
|
+ }else{
|
|
|
+ setTimeout(function(){
|
|
|
+ that.$router.back();
|
|
|
+ that.isSubmit = false;
|
|
|
+ },2000)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ api.save({...this.knowledgeForm, categoryId: this.knowledgeForm.categoryId.slice(-1)[0], pkId: this.pkId}).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ setTimeout(() =>
|
|
|
+ this.$router.back()
|
|
|
+ ,2000)
|
|
|
+ }
|
|
|
})
|
|
|
+ }
|
|
|
},
|
|
|
// 处理分类数据展示
|
|
|
categoryData(data){
|