You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wkcrm/static/js/chunk-4e39.92d03c12.js

1 line
24 KiB

3 years ago
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4e39"],{"0Lhk":function(e,t,a){"use strict";var n=a("aKO9");a.n(n).a},"1fUt":function(e,t,a){},"2Xr9":function(e,t,a){"use strict";a.r(t);var n=a("/861"),i=a("ViDN"),s=a("KTTK"),l=a("8GhS"),o=a("XAon"),c=a("Ktth"),r=a.n(c),u={name:"CreateSystemExamine",components:{CreateView:i.a,XhInput:l.g,XhTextarea:l.o,XhSelect:l.l,WkUserSelect:o.a,XhStrucUserCell:l.m},filters:{typeToComponentName:function(e){return"text"==e?"XhInput":"textarea"==e?"XhTextarea":"select"==e?"XhSelect":"structure"==e?"XhStrucUserCell":void 0},numberToZh:function(e){return r.a.encodeS(e)}},props:{handle:{type:Object,default:function(){return{type:"examineflow",action:"save",id:"",data:null}}}},data:function(){return{loading:!1,crmRules:{},crmForm:{crmFields:[]},currentPage:1,config:1,examineList:[{type:1,value:[],show:!1,options:[{name:"负责人主管",value:1},{name:"指定用户(任意一人)",value:2},{name:"指定用户(多人会签)",value:3}]}]}},computed:{queryUserListAPI:function(){return s.y},title:function(){if("examineflow"===this.handle.type){if("save"===this.handle.action)return"新建审批流程";if("update"===this.handle.action)return"编辑审批流程"}return""}},mounted:function(){if(document.body.appendChild(this.$el),this.getField(),this.handle.data)if(this.handle.data.config&&1===this.handle.data.config){this.config=1,this.examineList=[];for(var e=0;e<this.handle.data.stepList.length;e++){var t=this.handle.data.stepList[e],a={};a.type=t.status,2===t.status||3===t.status?(a.show=!0,a.value=t.user_id_info):(a.show=!1,a.value=[]),a.options=0===e?[{name:"负责人主管",value:1},{name:"指定用户(任意一人)",value:2},{name:"指定用户(多人会签)",value:3}]:[{name:"负责人主管",value:1},{name:"指定用户(任意一人)",value:2},{name:"指定用户(多人会签)",value:3},{name:"上一级审批人主管",value:4}],this.examineList.push(a)}}else this.config=0},destroyed:function(){this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)},methods:{fieldValueChange:function(e){this.crmForm.crmFields[e.index].value=e.value},getField:function(){var e=[];e.push({field:"name",formType:"text",isNull:1,name:"审批流名称",setting:[],inputTips:"",value:this.handle.data?this.handle.data.name:""}),e.push({field:"categoryType",formType:"select",isNull:0,name:"关联对象",setting:[{name:"合同",value:"crm_contract",type:"crm_contract"},{name:"回款",value:"crm_receivables",type:"crm_receivables"},{name:"发票",value:"crm_invoice",type:"crm_invoice"}],value:this.handle.data?this.handle.data.types:"crm_contract"}),e.push({field:"dept",formType:"structure",isNull:0,name:"应用部门",setting:[],inputTips:"默认全公司",value:{users:this.handle.data?this.handle.data.user_ids_info:[],strucs:this.handle.data?this.handle.data.structure_ids_info:[]}}),e.push({field:"remark",formType:"textarea",isNull:0,name:"流程说明",setting:[],inputTips:"请填写相关注意事项方便员工在申请时查阅限制输入200字",value:this.handle.data?this.handle.data.remark:""}),this.getcrmRulesAndModel(e)},getcrmRulesAndModel:function(e){for(var t=0;t<e.length;t++){var a=e[t],n=[];1==a.isNull&&n.push({required:!0,message:a.name+"不能为空",trigger:["blur","change"]}),this.crmRules[a.field]=n;var i={};i.value=a.value,i.key=a.field,i.data=a,"textarea"==a.formType&&(i.showblock=!0),this.crmForm.crmFields.push(i)}},saveField:function(){var e=this;this.$refs.crmForm.validate(function(t){if(!t)return e.$message.error("请完善必填信息"),!1;e.validStepsInfo()&&e.submiteParams(e.crmForm.crmFields)})},validStepsInfo:function(){for(var e=0;e<this.examineList.length;e++){var t=this.examineList[e];if((2===t.type||3===t.type)&&0===t.value.length)return this.$message.error("请添加员工"),!1}return!0},submiteParams:function(e){var t=this,a=this.getSubmiteParams(e);"update"==this.handle.action&&(a.flow_id=this.handle.data.flow_id),Object(n.h)(a).then(function(e){t.loading=!1,t.hidenView(),t.$message.success("操作成功"),t.$emit("save"