app.8931ccf8fede6867ef49.js 142 KB
webpackJsonp([1],{"/Cky":function(t,e){},0:function(t,e,a){a("j1ja"),t.exports=a("NHnr")},"2Gcp":function(t,e){},"7Otq":function(t,e,a){t.exports=a.p+"static/img/logo.05d5a52.png"},IOLY:function(t,e){},NHnr:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a("//Fk"),o=a.n(s),n=a("7+uW"),r={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("router-view")],1)},staticRenderFns:[]};var i=a("VU/8")({name:"App",methods:{},data:function(){return{}}},r,!1,function(t){a("dGCZ")},null,null).exports,c=a("/ocq"),l=a("mvHQ"),_=a.n(l),d={name:"HelloWorld",data:function(){return{color:"background-color: lightblue",management:!1,username:"",department:"",collapse:!0,contract_show:!0}},methods:{contract:function(){sessionStorage.getItem("modify")&&sessionStorage.removeItem("modify")},exit:function(){var t=this;this.$confirm("确认退出?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){sessionStorage.clear(),t.$router.push({path:"/"})}).catch(function(){})}},beforeCreate:function(){sessionStorage.getItem("login_check")||(alert("请登录"),this.$router.push({path:"/"}))},created:function(){if("null"!=sessionStorage.getItem("user_roles")&&sessionStorage.getItem("user_roles"))for(var t=JSON.parse(sessionStorage.getItem("user_roles")),e=0;e<t.length;e++){t[e].role_unid}else this.contract_show=!1;if("Admin"===sessionStorage.getItem("user_name")&&(this.management=!0),sessionStorage.getItem("manager")&&(this.management=!0,this.contract_show=!0),localStorage.getItem("color")){var a={};switch(localStorage.getItem("color")){case"天空蓝":this.color="background-color: lightblue",a.color="lightblue",a.image=null;break;case"梦幻紫":this.color="background-color:#8ec5fc;background-image:linear-gradient(225deg, #8ec5fc 0%, #e0c3fc 100%)",a.color="#8ec5fc",a.image="linear-gradient(225deg, #8ec5fc 0%, #e0c3fc 100%)";break;case"活力橙":this.color="background-color:#FBAB7E;background-image:linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)",a.color="#FBAB7E",a.image="linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)";break;case"柠檬绿":this.color="background-color:#F4D03F;background-image:linear-gradient(71deg, #F4D03F 0%, #16a046 92%)",a.color="#F4D03F",a.image="linear-gradient(71deg, #F4D03F 0%, #16a046 92%)";break;case"灰灰灰":this.color="background-color:#f0f0f0",a.color="#f0f0f0",a.image=null;break;case"小清新":this.color="background-color:#FFDEE9;background-image:linear-gradient(0deg, #FFDEE9 0%, #B5FFFC 100%)",a.color="#FFDEE9",a.image="linear-gradient(0deg, #FFDEE9 0%, #B5FFFC 100%)"}localStorage.setItem("style",_()(a))}}},p={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-container",{attrs:{id:"nav"}},[s("el-aside",{attrs:{width:"10%"}},[s("el-menu",{staticClass:"el-menu-vertical-demo",attrs:{"default-active":t.$route.path,router:"",collapse:!1,"text-color":"white","background-color":"black","active-text-color":"#ffd04b"}},[s("div",{staticStyle:{height:"20%","text-align":"center"}},[s("img",{staticStyle:{width:"100%",height:"26%"},attrs:{src:a("7Otq"),alt:""}})]),t._v(" "),s("el-menu-item",{attrs:{index:"/nav/search"}},[s("i",{staticClass:"icon i-search"}),t._v(" "),s("span",{attrs:{slot:"title"},slot:"title"},[t._v("检索合同")])]),t._v(" "),t.contract_show?s("el-menu-item",{attrs:{index:"/nav/contract/0"},on:{click:t.contract}},[s("i",{staticClass:"icon i-file"}),t._v(" "),s("span",{attrs:{slot:"title"},slot:"title"},[t._v("合同信息")])]):t._e(),t._v(" "),s("el-menu-item",{attrs:{index:"/nav/user"}},[s("i",{staticClass:"icon i-user"}),t._v(" "),s("span",{attrs:{slot:"title"},slot:"title"},[t._v("个人管理")])]),t._v(" "),s("el-menu-item",{directives:[{name:"show",rawName:"v-show",value:t.management,expression:"management"}],attrs:{index:"/nav/manage"}},[s("i",{staticClass:"icon i-setting"}),t._v(" "),s("span",{attrs:{slot:"title"},slot:"title"},[t._v("后台管理")])]),t._v(" "),s("el-menu-item",{attrs:{index:""},on:{click:t.exit}},[s("i",{staticClass:"icon i-login"}),t._v(" "),s("span",{attrs:{slot:"title"},slot:"title"},[t._v("退出")])])],1)],1),t._v(" "),s("el-main",{style:t.color},[s("keep-alive",{attrs:{include:"search"}},[s("router-view")],1)],1)],1)},staticRenderFns:[]};var u=a("VU/8")(d,p,!1,function(t){a("PL5t")},null,null).exports,m={name:"login",data:function(){return{password_type:"password",view_password:"icon i-password-not-view",contract_base_url:this.$disparch_data.contract_base_url,code_base_url:this.$disparch_data.code_base_url,auth_base_url:this.$disparch_data.auth_base_url,net_error:!1,form:{username:"",password:""},rules:{username:[{required:!0,message:"请输入用户名",trigger:"blur"}]}}},methods:{show_password:function(){"password"==this.password_type?(this.password_type="text",this.view_password="icon i-password-view"):(this.password_type="password",this.view_password="icon i-password-not-view")},submitForm:function(t){var e=this;this.$refs[t].validate(function(t){t&&e.$Axios({method:"post",url:e.auth_base_url+"users/login",headers:{"Content-Type":"application/json"},data:{user_type:"user",username:e.form.username,password:e.form.password}}).then(function(t){t.data.ecode?e.$message({message:t.data.enote,type:"error"}):(window.localStorage.setItem("username",e.form.username),sessionStorage.setItem("login_check",!0),sessionStorage.setItem("user_unid",t.data.user_unid),sessionStorage.setItem("rtoken",t.data.rtoken),sessionStorage.setItem("user_roles",_()(t.data.roles)),sessionStorage.setItem("user_name",t.data.user_name),e.get_provinces(),e.get_contract_state_data(),e.get_contract_type_data(),e.get_amount_state_unid_data(),e.get_mainten_start_point_data(),e.get_product_line_type_data(),e.get_payment_type_data(),e.$router.push({path:"/nav/main"}))}).catch(function(t){e.$message({message:"登录错误",type:"error"})})})},resetForm:function(t){this.$refs[t].resetFields()},is_login:function(){},get_provinces:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"countries/0E229CD043/provinces"}).then(function(t){sessionStorage.setItem("provinces",_()(t.data.list_data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_contract_state_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/13BEFACBCF/codes"}).then(function(t){sessionStorage.setItem("contract_state_data",_()(t.data.list_data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_contract_type_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/8EC31D08A0/codes"}).then(function(t){sessionStorage.setItem("contract_type_data",_()(t.data.list_data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_amount_state_unid_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/42407C5EF2/codes"}).then(function(t){sessionStorage.setItem("amount_state_unid_data",_()(t.data.list_data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_mainten_start_point_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/55B997D596/codes"}).then(function(t){sessionStorage.setItem("mainten_start_point_data",_()(t.data.list_data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_product_line_type_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/4FC51AD3C9/codes"}).then(function(t){sessionStorage.setItem("product_line_type_data",_()(t.data.list_data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_payment_type_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/215649FB93/codes"}).then(function(t){sessionStorage.setItem("payment_type_data",_()(t.data.list_data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_salesperson:function(){var t=this;this.$Axios({method:"get",url:this.auth_base_url+"users",params:{norm_type:"employee"}}).then(function(t){sessionStorage.setItem("salesperson_unid_selected_data",_()(t.data.list_data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_contract_unid:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"codes"}).then(function(t){sessionStorage.setItem("contract_unid_selected_data",_()(t.data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},get_projects:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"projects",headers:{"Content-Type":"application/json"}}).then(function(t){sessionStorage.setItem("project_unid_selected_data",_()(t.data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})},manager:function(){sessionStorage.setItem("manager","1"),sessionStorage.setItem("login_check","1"),this.get_provinces(),this.get_contract_state_data(),this.get_contract_type_data(),this.get_amount_state_unid_data(),this.get_mainten_start_point_data(),this.get_product_line_type_data(),this.get_payment_type_data(),this.$router.push({path:"/nav/main"})},get_customers:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"customers",headers:{"Content-Type":"application/json"}}).then(function(t){sessionStorage.setItem("customer_unid_selected_data",_()(t.data))}).catch(function(e){t.$router.push({path:"/"}),t.$message({message:"网络错误",type:"error"})})}},mounted:function(){this.form.username=localStorage.getItem("username")}},f={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"color-change-5x ",attrs:{id:"login_box"},on:{click:function(e){return e.ctrlKey&&e.metaKey&&e.altKey?t.manager(e):null}}},[a("el-row",{staticStyle:{height:"80%"},attrs:{type:"flex",justify:"center",align:"middle"}},[a("el-card",{staticClass:"box-card",staticStyle:{"min-width":"25%"},attrs:{shadow:"always"}},[a("div",{staticClass:"clearfix",staticStyle:{"text-align":"center"},attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px"}},[t._v("合同管理系统")])]),t._v(" "),a("div",[a("p",{attrs:{id:"fankui"}},[t._v("使用中出现任何问题请及时反馈")])]),t._v(" "),a("el-form",{ref:"login_form",attrs:{id:"aa",model:t.form,rules:t.rules,"label-width":"60px","label-position":"top"}},[a("el-form-item",{attrs:{prop:"username"}},[a("el-input",{attrs:{id:"name"},model:{value:t.form.username,callback:function(e){t.$set(t.form,"username",e)},expression:"form.username"}},[a("template",{slot:"prepend"},[t._v("姓名")])],2)],1),t._v(" "),a("el-form-item",{attrs:{prop:"password"}},[a("el-input",{attrs:{id:"password",type:t.password_type,"auto-complete":"off"},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.submitForm("login_form")}},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}},[a("template",{slot:"prepend"},[t._v("密码")]),t._v(" "),a("el-button",{attrs:{slot:"append",icon:t.view_password},on:{click:t.show_password},slot:"append"})],2)],1),t._v(" "),a("el-form-item",[a("el-button-group",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("login_form")}}},[t._v("提交")]),t._v(" "),a("el-button",{on:{click:function(e){t.resetForm("login_form")}}},[t._v("重置")])],1)],1)],1)],1)],1)],1)},staticRenderFns:[]};var h=a("VU/8")(m,f,!1,function(t){a("eCAb")},"data-v-b4a8c4b6",null).exports,g=a("fZjL"),v=a.n(g),b={pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,message:"请输入正确",trigger:"blur"},y={name:"search",data:function(){return{management:!1,checked_item_list:[],check_all:!1,is_indeterminate:!1,display_item_list:[{key:"customer_name",value:"客户姓名"},{key:"year",value:"所属年份"},{key:"month",value:"所属月份"},{key:"sign_date",value:"签订日期"},{key:"salesperson_unid",value:"销售员"},{key:"product_line_type",value:"产品线类型"},{key:"province",value:"省"},{key:"city",value:"市"},{key:"project_name",value:"项目名称"},{key:"contract_amount",value:"合同金额"},{key:"stop_amount",value:"暂停金额"},{key:"exemptions_amount",value:"豁免金额"},{key:"deduct_amount",value:"折扣金额"},{key:"total_reback_amount",value:"累计已收款"},{key:"contract_remain",value:"合同余额"},{key:"amount_state_unid",value:"账款状态"},{key:"total_receive_amount",value:"累计应收款"},{key:"total_amount_remain",value:"应收账款余额"},{key:"over_days",value:"逾期天数"},{key:"advance_pay",value:"预付款金额"},{key:"advance_pay_date",value:"预付款到期日"},{key:"arrive_pay",value:"到货款金额"},{key:"deliver_date",value:"发货日期"},{key:"arrive_pay_date",value:"到货款到期日"},{key:"acceptanc_pay",value:"验收款金额"},{key:"acceptanc_date",value:"验收日期"},{key:"acceptanc_pay_date",value:"验收款到期日"},{key:"mainten_pay",value:"质保金额"},{key:"mainten_pay_date",value:"质保款到期日"},{key:"goods_acceptanc_date",value:"到货验收日期"}],export_item_selected_dialog_show:!1,hide_icon:"icon i-arrowdown-copy",hide_text:"显示更多",hide_search_item:!0,sales:!1,salesperson_name:null,provinces:[],cities:[],counties:[],code_base_url:this.$disparch_data.code_base_url,contract_base_url:this.$disparch_data.contract_base_url,month_list:["01","02","03","04","05","06","07","08","09","10","11","12"],contract_state_data:[],contract_type_data:[],product_line_type_data:[],amount_state_unid_data:[],search_form:{contract_unid:null,salesperson_unid:null,salesperson_name__like:null,project_name__like:null,customer_name__like:null,guarantee_period:null,year:null,month:null,contract_state:null,contract_type:null,product_line_type:null,acceptance_type:null,is_archive:null,amount_state_unid:null,confirm_income_amount:null,province:null,city:null,start_data:null,end_date:null,overdays_start_point:null,overdays_end_point:null,amount_start_point:null,amount_end_point:null,leave_amount_start_point:null,leave_amount_end_point:null},list_data:[],limit:10,total_data:0,current_page:1,search_form_rules:{confirm_income_amount:b,amount_start_point:b,amount_end_point:b,leave_amount_start_point:b,leave_amount_end_point:b,overdays_start_point:{pattern:/((^[1-9]\d*)|^0)$/,message:"请输入正确天数",trigger:"blur"},overdays_end_point:{pattern:/((^[1-9]\d*)|^0)$/,message:"请输入正确天数",trigger:"blur"}}}},computed:{year_list:function(){for(var t=[],e=(new Date).getFullYear();e>=2e3;e--)t.push(e);return t},offset:function(){return(this.current_page-1)*this.limit},guarantee_period_list:function(){for(var t=[],e=6,a=0;a<10;a++){t.push(e),e+=6}return t}},methods:{delete_contract:function(t){var e=this;this.$confirm("是否删除合同:<p style='text-align:center;color:red;font-weight:bolder'>"+t+"<p>","确认信息",{dangerouslyUseHTMLString:!0,confirmButtonText:"确认删除",cancelButtonText:"取消"}).then(function(){e.delete_contract_by_unid(t)}).catch(function(){e.$message({type:"info",message:"放弃删除"})})},delete_contract_by_unid:function(t){var e=this;this.$Axios({method:"delete",url:this.contract_base_url+t}).then(function(t){e.get_list_data(),"200"==t.data.ecode?e.$message({type:"success",message:"删除成功"}):e.$message({type:"warning",message:"删除失败"})}).catch(function(t){console.log(t),e.$message({type:"warning",message:"删除失败"})})},check_all_item:function(t){var e=this;t?this.display_item_list.forEach(function(t){e.checked_item_list.push(t.key)}):this.checked_item_list=[],this.is_indeterminate=!1},chek_item:function(t){var e=t.length;this.check_all=e===this.display_item_list.length,this.is_indeterminate=e>0&&e<this.display_item_list.length},project_name_sort:function(t,e){if(t.project_name&&e.project_name)return t.project_name.trim().localeCompare(e.project_name.trim())},customer_name_sort:function(t,e){if(t.customer&&e.customer_name)return t.customer_name.trim().localeCompare(e.customer_name.trim())},salesperson_name_sort:function(t,e){if(t.salesperson_name&&e.salesperson_name)return t.salesperson_name.trim().localeCompare(e.salesperson_name.trim())},sign_date_sort:function(t,e){if(null==t.sign_date&&null==e.sign_date)return 0;if(null==t.sign_date)return-1;if(null==e.sign_date)return 1;var a=t.sign_date.split("-"),s=e.sign_date.split("-");return new Date(a[0],a[1]-1,a[2]).getTime()-new Date(s[0],s[1]-1,s[2]).getTime()},contract_amount_sort:function(t,e){return this.amount_sort(t.contract_amount,e.contract_amount)},total_reback_amount_sort:function(t,e){return this.amount_sort(t.total_reback_amount,e.total_reback_amount)},contract_remain_sort:function(t,e){return this.amount_sort(t.contract_remain,e.contract_remain)},total_amount_remain_sort:function(t,e){return this.amount_sort(t.total_amount_remain,e.total_amount_remain)},amount_sort:function(t,e){return null==t&&null==e?0:null==t?-1:null==e?1:t-e},show_more:function(){this.hide_search_item=!this.hide_search_item,1==this.hide_search_item?this.hide_text="显示更多":this.hide_text="收起",1==this.hide_search_item?this.hide_icon="icon i-arrowdown-copy":this.hide_icon="icon i-arrowup"},import_click:function(){document.getElementById("import_unview").click()},import_contract:function(){var t=this;if(document.getElementById("import_unview").files[0]){var e=new FormData;e.append("file",document.getElementById("import_unview").files[0]),this.$Axios({method:"post",url:this.contract_base_url+"import",data:e}).then(function(e){if("500"==e.data.ecode)t.$message.error(e.data.enote);else if("200"==e.data.ecode)t.$message({type:"success",message:"导入成功"});else if(e.data!=[]&&e.data[0].contract_unid){var a=[],s=t.$createElement;e.data.forEach(function(t){a.push(s("p",null,t.contract_unid))}),t.$message({type:"warning",message:"部分导入信息数据校验未通过,请检查后重新导入",duration:5e3}),t.$notify({title:"校验未通过的合同的编号为:",duration:0,message:s("p",null,a),type:"error"})}else if(e.data.length>0){a=[];var o=t.$createElement;e.data.forEach(function(t){a.push(o("p",null,t))}),t.$message({type:"warning",message:"部分导入信息已存在,请检查后重新导入",duration:5e3}),t.$notify({title:"重复的数据编号",duration:0,message:o("p",null,a),type:"error"})}document.getElementById("import_unview").value=""}).catch(function(t){console.log(t.message)})}},get_amount_state_unid_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/42407C5EF2/codes"}).then(function(e){t.amount_state_unid_data=e.data.list_data}).catch(function(t){})},get_contract_type_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/8EC31D08A0/codes"}).then(function(e){t.contract_type_data=e.data.list_data}).catch(function(t){})},get_contract_state_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/13BEFACBCF/codes"}).then(function(e){t.contract_state_data=e.data.list_data}).catch(function(t){})},get_product_line_type_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/4FC51AD3C9/codes"}).then(function(e){t.product_line_type_data=e.data.list_data}).catch(function(t){})},get_provinces:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"countries/0E229CD043/provinces"}).then(function(e){t.provinces=e.data.list_data}).catch(function(t){console.log(t.message)})},get_cities:function(){var t=this;this.search_form.city="",this.search_form.province&&this.$Axios({method:"get",url:this.code_base_url+"countries/0E229CD043/provinces/"+this.search_form.province+"/cities"}).then(function(e){t.cities=e.data.list_data}).catch(function(t){console.log(t.message)})},get_list_data:function(){var t=this,e=this.search_form;v()(e).forEach(function(t){e[t]&&"string"==typeof e[t]&&(console.log(e[t]),e[t]=e[t].trim())}),e.offset=this.offset,e.limit=this.limit,this.$Axios({methods:"get",url:this.contract_base_url,params:e,headers:{"Content-Type":"application/json"}}).then(function(e){if("500"!=e.data.ecode){t.total_data=e.data.total_number,t.list_data=e.data.list_data;for(var a=0;a<t.list_data.length;a++){for(var s=t.list_data[a],o=0;o<t.contract_state_data.length;o++){var n=t.contract_state_data[o];s.contract_state==n.code&&(t.list_data[a].contract_state_name=n.name)}for(var r=0;r<t.product_line_type_data.length;r++){var i=t.product_line_type_data[r];s.product_line_type==i.code&&(t.list_data[a].product_line_type_name=i.name)}s.over_days||(s.over_days=0)}}else t.$message.error("筛选异常")}).catch(function(t){console.log(t.message)})},get_year:function(t){if(t)return t.slice(0,4)},get_month:function(t){if(t)return t.slice(5,7)},reset:function(){this.$refs.search_form.resetFields()},commit:function(){var t=this;this.$refs.search_form.validate(function(e){e?(t.current_page=1,sessionStorage.setItem("search_condition",_()(t.search_form)),t.get_list_data()):t.$message({type:"warning",message:"请检查数据格式是否正确"})})},handle_size_change:function(t){this.limit=t,0!=this.list_data.length&&this.get_list_data()},page_change:function(t){this.search_form=JSON.parse(sessionStorage.getItem("search_condition")),this.current_page=t,console.log(this.current_page),this.get_list_data()},export_contract:function(){var t=this;this.checked_item_list.length>0&&(this.search_form.columns=this.checked_item_list.join(",")),console.log(this.search_form.columns),this.$Axios({method:"get",url:this.contract_base_url+"export",params:this.search_form,responseType:"blob"}).then(function(e){var a=new Blob([e.data],{type:"application/vnd.ms-excel;charset=UTF-8"});if(navigator.appVersion.toString().indexOf(".NET")>0)window.navigator.msSaveBlob(a,"合同.xlsx");else{var s=document.createElement("a"),o=window.URL.createObjectURL(a);s.href=o,s.download="合同.xlsx",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(o)}t.export_item_selected_dialog_show=!1}).catch(function(e){t.checked_item_list=[],console.log(e.message)})},go_to:function(t){sessionStorage.setItem("modify","1"),this.$router.push("/nav/contract/"+t)},change_dialog:function(){if(localStorage.getItem("style"))for(var t=JSON.parse(localStorage.getItem("style")),e=document.getElementsByClassName("el-dialog"),a=0;a<e.length;a++){var s=e[a];s.style.backgroundColor=t.color,s.style.backgroundImage=t.image}}},created:function(){"null"==sessionStorage.getItem("user_roles")&&(this.salesperson_name=sessionStorage.getItem("user_name"),this.sales=!0,this.search_form.salesperson_unid=sessionStorage.getItem("user_unid")),sessionStorage.getItem("provinces")?this.provinces=JSON.parse(sessionStorage.getItem("provinces")):this.get_provinces(),sessionStorage.getItem("amount_state_unid_data")?this.amount_state_unid_data=JSON.parse(sessionStorage.getItem("amount_state_unid_data")):this.get_amount_state_unid_data(),sessionStorage.getItem("contract_type_data")?this.contract_type_data=JSON.parse(sessionStorage.getItem("contract_type_data")):this.get_contract_type_data(),sessionStorage.getItem("contract_state_data")?this.contract_state_data=JSON.parse(sessionStorage.getItem("contract_state_data")):this.get_contract_state_data(),sessionStorage.getItem("product_line_type_data")?this.product_line_type_data=JSON.parse(sessionStorage.getItem("product_line_type_data")):this.get_product_line_type_data(),"Admin"===sessionStorage.getItem("user_name")&&(this.management=!0)},mounted:function(){this.change_dialog()}},w={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"search"},on:{keypress:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;e.preventDefault(),t.commit()}}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix ",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px","padding-right":"0px",color:"#eff0dc"}},[t._v("检索条件")])]),t._v(" "),a("el-form",{ref:"search_form",staticClass:"demo-form-inline",attrs:{id:"form",inline:!0,model:t.search_form,"label-width":"100px",rules:t.search_form_rules}},[a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"合同编号",prop:"contract_unid"}},[a("el-input",{staticStyle:{width:"217px"},model:{value:t.search_form.contract_unid,callback:function(e){t.$set(t.search_form,"contract_unid",e)},expression:"search_form.contract_unid"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"项目名称",prop:"project_name__like"}},[a("el-input",{staticStyle:{width:"217px"},model:{value:t.search_form.project_name__like,callback:function(e){t.$set(t.search_form,"project_name__like",e)},expression:"search_form.project_name__like"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"客户名称",prop:"customer_name__like"}},[a("el-input",{staticStyle:{width:"217px"},model:{value:t.search_form.customer_name__like,callback:function(e){t.$set(t.search_form,"customer_name__like",e)},expression:"search_form.customer_name__like"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"账款状态",prop:"amount_state_unid"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.amount_state_unid,callback:function(e){t.$set(t.search_form,"amount_state_unid",e)},expression:"search_form.amount_state_unid"}},t._l(t.amount_state_unid_data,function(t){return a("el-option",{key:t.code,attrs:{label:t.name,value:t.code}})}))],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"应收账款余额",prop:"leave_amount_start_point"}},[a("el-input",{attrs:{placeholder:"不填默认为0"},model:{value:t.search_form.leave_amount_start_point,callback:function(e){t.$set(t.search_form,"leave_amount_start_point",e)},expression:"search_form.leave_amount_start_point"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"leave_amount_end_point"}},[a("el-input",{attrs:{placeholder:"不填则无上限"},model:{value:t.search_form.leave_amount_end_point,callback:function(e){t.$set(t.search_form,"leave_amount_end_point",e)},expression:"search_form.leave_amount_end_point"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[t.sales?a("el-form-item",{attrs:{label:"销售员"}},[a("el-input",{staticStyle:{width:"217px"},attrs:{readonly:!0},model:{value:t.salesperson_name,callback:function(e){t.salesperson_name=e},expression:"salesperson_name"}})],1):t._e(),t._v(" "),t.sales?t._e():a("el-form-item",{attrs:{label:"销售员",prop:"salesperson_name__like"}},[a("el-input",{staticStyle:{width:"217px"},model:{value:t.search_form.salesperson_name__like,callback:function(e){t.$set(t.search_form,"salesperson_name__like",e)},expression:"search_form.salesperson_name__like"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"margin-bottom":"10px"}},[a("span",{attrs:{id:"hide_icon_text"},on:{click:t.show_more}},[t._v("-------\n          "),a("i",{class:t.hide_icon},[t._v(t._s(t.hide_text))]),t._v("  -------\n        ")])]),t._v(" "),a("el-collapse-transition",[a("div",{directives:[{name:"show",rawName:"v-show",value:!t.hide_search_item,expression:"!hide_search_item"}],attrs:{id:"hide"}},[a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"合同状态",prop:"contract_state"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.contract_state,callback:function(e){t.$set(t.search_form,"contract_state",e)},expression:"search_form.contract_state"}},t._l(t.contract_state_data,function(t){return a("el-option",{key:t.code,attrs:{label:t.name,value:t.code}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"所属年份",prop:"year"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.year,callback:function(e){t.$set(t.search_form,"year",e)},expression:"search_form.year"}},t._l(t.year_list,function(t){return a("el-option",{key:t,attrs:{label:t,value:t}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"所属月份",prop:"month"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.month,callback:function(e){t.$set(t.search_form,"month",e)},expression:"search_form.month"}},t._l(t.month_list,function(t){return a("el-option",{key:t,attrs:{label:t,value:t}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"合同性质",prop:"contract_type"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.contract_type,callback:function(e){t.$set(t.search_form,"contract_type",e)},expression:"search_form.contract_type"}},t._l(t.contract_type_data,function(t){return a("el-option",{key:t.code,attrs:{label:t.name,value:t.code}})}))],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"产品线类型",prop:"product_line_type"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.product_line_type,callback:function(e){t.$set(t.search_form,"product_line_type",e)},expression:"search_form.product_line_type"}},t._l(t.product_line_type_data,function(t){return a("el-option",{key:t.code,attrs:{label:t.name,value:t.code}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"是否终验",prop:"acceptance_type"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.acceptance_type,callback:function(e){t.$set(t.search_form,"acceptance_type",e)},expression:"search_form.acceptance_type"}},[a("el-option",{attrs:{label:"是",value:1}}),t._v(" "),a("el-option",{attrs:{label:"否",value:0}})],1)],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"是否归档",prop:"is_archive"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.is_archive,callback:function(e){t.$set(t.search_form,"is_archive",e)},expression:"search_form.is_archive"}},[a("el-option",{attrs:{label:"是",value:"true"}}),t._v(" "),a("el-option",{attrs:{label:"否",value:"false"}})],1)],1)],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"确认收入金额",prop:"confirm_income_amount"}},[a("el-input",{staticStyle:{width:"217px"},model:{value:t.search_form.confirm_income_amount,callback:function(e){t.$set(t.search_form,"confirm_income_amount",e)},expression:"search_form.confirm_income_amount"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"质保周期(月)",prop:"guarantee_period"}},[a("el-select",{attrs:{clearable:""},model:{value:t.search_form.guarantee_period,callback:function(e){t.$set(t.search_form,"guarantee_period",e)},expression:"search_form.guarantee_period"}},t._l(t.guarantee_period_list,function(t){return a("el-option",{key:t,attrs:{label:t,value:t}})}))],1)],1),t._v(" "),a("el-col",{staticStyle:{"text-align":"left"},attrs:{span:6}},[a("el-form-item",{attrs:{label:"省",prop:"province"}},[a("el-select",{staticStyle:{width:"217px"},attrs:{filterable:"",clearable:"",placeholder:"省"},on:{change:function(e){t.get_cities()}},model:{value:t.search_form.province,callback:function(e){t.$set(t.search_form,"province",e)},expression:"search_form.province"}},t._l(t.provinces,function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.province_unid}})}))],1)],1),t._v(" "),a("el-col",{staticStyle:{"text-align":"left"},attrs:{span:6}},[a("el-form-item",{attrs:{label:"市",prop:"city"}},[a("el-select",{staticStyle:{width:"217px"},attrs:{filterable:"",clearable:"",placeholder:"市"},model:{value:t.search_form.city,callback:function(e){t.$set(t.search_form,"city",e)},expression:"search_form.city"}},t._l(t.cities,function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.city_unid}})}))],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"签订日期",prop:"start_date"}},[a("el-date-picker",{staticStyle:{width:"202px"},attrs:{type:"date",placeholder:"开始日期","value-format":"yyyy-MM-dd"},model:{value:t.search_form.start_date,callback:function(e){t.$set(t.search_form,"start_date",e)},expression:"search_form.start_date"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"end_date"}},[a("el-date-picker",{staticStyle:{width:"202px"},attrs:{type:"date",placeholder:"结束日期","value-format":"yyyy-MM-dd"},model:{value:t.search_form.end_date,callback:function(e){t.$set(t.search_form,"end_date",e)},expression:"search_form.end_date"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"逾期天数",prop:"overdays_start_point"}},[a("el-input",{attrs:{placeholder:"不填默认为0"},model:{value:t.search_form.overdays_start_point,callback:function(e){t.$set(t.search_form,"overdays_start_point",e)},expression:"search_form.overdays_start_point"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"overdays_end_point"}},[a("el-input",{attrs:{placeholder:"不填则无上限"},model:{value:t.search_form.overdays_end_point,callback:function(e){t.$set(t.search_form,"overdays_end_point",e)},expression:"search_form.overdays_end_point"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"合同金额",prop:"amount_start_point"}},[a("el-input",{attrs:{placeholder:"不填默认为0"},model:{value:t.search_form.amount_start_point,callback:function(e){t.$set(t.search_form,"amount_start_point",e)},expression:"search_form.amount_start_point"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"amount_end_point"}},[a("el-input",{attrs:{placeholder:"不填则无上限"},model:{value:t.search_form.amount_end_point,callback:function(e){t.$set(t.search_form,"amount_end_point",e)},expression:"search_form.amount_end_point"}})],1)],1)],1)],1)])],1),t._v(" "),a("el-row",[a("el-button-group",{staticStyle:{float:"right"}},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){t.commit()}}},[t._v("检索")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){t.reset()}}},[t._v("重置")])],1)],1)],1),t._v(" "),a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px","padding-right":"0px",color:"#eff0dc"}},[t._v("检索结果")])]),t._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{id:"data_table",data:t.list_data,"row-key":"contract_unid",border:""}},[a("el-table-column",{attrs:{type:"expand"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-row",{staticStyle:{"text-align":"left","padding-bottom":"5px"},attrs:{type:"flex",justify:"space-between"}},[a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("暂停金额:")]),t._v(t._s(e.row.stop_amount)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("坏账金额:")]),t._v(t._s(e.row.bad_amount)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("豁免金额:")]),t._v(t._s(e.row.exemptions_amount)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("抵扣金额:")]),t._v(t._s(e.row.deduct_amount)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("合同状态:")]),t._v(t._s(e.row.contract_state_name)+"\n            ")])],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left","padding-bottom":"5px"},attrs:{type:"flex",justify:"space-between"}},[a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("验收款金额:")]),t._v(t._s(e.row.acceptanc_pay)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("产品线类型:")]),t._v(t._s(e.row.product_line_type_name)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("累计应收:")]),t._v(t._s(e.row.total_receive_amount)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("逾期天数:")]),t._v(t._s(e.row.over_days)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("质保金额:")]),t._v(t._s(e.row.mainten_pay_deliver)+"\n            ")])],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left","padding-bottom":"5px"},attrs:{type:"flex",justify:"space-between"}},[a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("预付款金额:")]),t._v(t._s(e.row.advance_pay)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("预付款到期日:")]),t._v(t._s(e.row.advance_pay_date)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("到货款金额:")]),t._v(t._s(e.row.arrive_pay)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("发货日期:")]),t._v(t._s(e.row.deliver_date)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("到货款到期日:")]),t._v(t._s(e.row.arrive_pay_date)+"\n            ")])],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left","padding-bottom":"5px"},attrs:{type:"flex",justify:"space-between"}},[a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("省:")]),t._v(t._s(e.row.province_name)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("市:")]),t._v(t._s(e.row.city_name)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("质保到期日:")]),t._v(t._s(e.row.mainten_pay_deliver_date)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("验收日期:")]),t._v(t._s(e.row.acceptanc_date)+"\n            ")]),t._v(" "),a("el-col",{attrs:{span:4}},[a("span",{staticClass:"pre"},[t._v("验收款到期日:")]),t._v(t._s(e.row.acceptanc_pay_date)+"\n            ")])],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left","padding-bottom":"5px"}},[a("span",{staticClass:"pre"},[t._v("备注:")]),t._v(t._s(e.row.contract_note)+"\n          ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{sortable:"",label:"合同编号",prop:"contract_unid","min-width":"110px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"","sort-method":t.project_name_sort,label:"项目名称",prop:"project_name","min-width":"150px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"","sort-method":t.customer_name_sort,label:"客户名称",prop:"customer_name","min-width":"150px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"","sort-method":t.salesperson_name_sort,label:"销售员",prop:"salesperson_name","min-width":"100px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"","sort-method":t.contract_amount_sort,label:"合同金额",prop:"contract_amount","min-width":"120px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"","sort-method":t.sign_date_sort,label:"签订时间",prop:"sign_date","min-width":"120px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"","sort-method":t.total_reback_amount_sort,label:"累计回款",prop:"total_reback_amount","min-width":"120px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"","sort-method":t.contract_remain_sort,label:"合同余额",prop:"contract_remain","min-width":"120px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"","sort-method":t.total_amount_remain_sort,label:"应收余额",prop:"total_amount_remain","min-width":"120px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{sortable:"",label:"账款状态",prop:"amount_state_unid_name","min-width":"120px",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100px",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.go_to(e.row.contract_unid)}}},[t._v("\n            详情\n          ")]),t._v(" "),t.management?a("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(a){t.delete_contract(e.row.contract_unid)}}},[t._v("\n            删除\n          ")]):t._e()]}}])})],1),t._v(" "),a("el-row",{staticStyle:{"padding-top":"50px"}},[a("el-col",{attrs:{span:20}},[a("el-pagination",{staticStyle:{float:"left"},attrs:{background:"",layout:"sizes,total,prev, pager, next","page-sizes":[10,50,100,300,500,1e3,1e6],total:t.total_data,"page-size":t.limit,"prev-text":"上一页","next-text":"下一页","current-page":t.current_page},on:{"size-change":t.handle_size_change,"current-change":t.page_change}})],1),t._v(" "),a("el-col",{attrs:{span:4}},[a("el-button-group",{staticStyle:{float:"right"}},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){t.export_item_selected_dialog_show=!0}}},[t._v("导出")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.import_click}},[t._v("导入")]),t._v(" "),a("input",{staticStyle:{display:"none"},attrs:{id:"import_unview",type:"file"},on:{change:t.import_contract}})],1)],1)],1)],1),t._v(" "),a("el-dialog",{attrs:{id:"export_item_dialog",title:"请选择导出项",visible:t.export_item_selected_dialog_show,width:"32%","show-close":!1},on:{"update:visible":function(e){t.export_item_selected_dialog_show=e}}},[a("div",{staticStyle:{"text-align":"left"}},[a("el-checkbox",{attrs:{indeterminate:t.is_indeterminate},on:{change:t.check_all_item},model:{value:t.check_all,callback:function(e){t.check_all=e},expression:"check_all"}},[t._v("全选")]),t._v(" "),a("el-checkbox-group",{staticStyle:{"margin-top":"20px"},on:{change:t.chek_item},model:{value:t.checked_item_list,callback:function(e){t.checked_item_list=e},expression:"checked_item_list"}},t._l(t.display_item_list,function(e){return a("el-checkbox",{key:e.key,attrs:{label:e.key}},[t._v(t._s(e.value))])}))],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button-group",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){t.export_contract()}}},[t._v("确定")]),t._v(" "),a("el-button",{attrs:{size:"small"},on:{click:function(e){t.export_item_selected_dialog_show=!1}}},[t._v("取消")])],1)],1)])],1)},staticRenderFns:[]};var x=a("VU/8")(y,w,!1,function(t){a("fi+V")},"data-v-17642c2c",null).exports,k={pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,message:"请填写正确金额",trigger:"blur"},$={name:"contract_information",data:function(){var t=this;return{hide_icon:"icon i-arrowdown-copy",hide_text:"显示更多",hide_contract_info:!0,payment_type_tag:0,contract_unid_disabled:!1,disabled_list:[1,1,1,1],contract_appendix_list:[],acceptancs_appendix_list:[],first_acceptancs_appendix_list:[],operate_type:[0,0,0,0,0,0],code_base_url:this.$disparch_data.code_base_url,contract_base_url:this.$disparch_data.contract_base_url,auth_base_url:this.$disparch_data.auth_base_url,contract_unid_selected_data:[],salesperson_unid_selected_data:[],project_unid_selected_data:[],customer_unid_selected_data:[],provinces:[],cities:[],modify_data:!1,modify_index:-1,payment_type_data:[],product_line_type_data:[],contract_state_data:[],contract_type_data:[],amount_state_unid_data:[],guarantee_date:[,],payments_dialog_show:!1,receipts_dialog_show:!1,rebacks_dialog_show:!1,delivers_dialog_show:!1,payments_show:!0,contract_show:!0,rebacks_show:!0,receipts_show:!0,delivers_show:!0,acceptanc_show:!0,form:{contract_unid:null,salesperson_unid:null,project_unid:null,customer_unid:null,province_value:"",city_value:"",guarantee_period:6,sign_date:"",product_line_type:null,contract_state:"30003",contract_type:null,contract_amount:null,deduct_amount:null,contract_amount_note:"",stop_amount:null,reback_note:"",exemptions_amount:null,contract_remain_note:"",is_archive:"",bad_amount:null,bad_amount_note:"",confirm_income_amount:"",amount_state_unid:"",contract_note:"",appendix_unids:[],start_guarantee_date:"",end_guarantee_date:""},first_acceptancs_form:{acceptanc_unid:"",acceptanc_type:"",acceptanc_date:"",acceptanc_note:"",appendix_unids:[]},final_acceptancs_form:{acceptanc_unid:"",acceptanc_type:"",acceptanc_date:"",acceptanc_note:"",appendix_unids:[]},delivers_data:[],delivers_form:{deliver_unid:null,deliver_goods_date:"",goods_acceptanc_date:"",appendix_unids:[],delivers_appendix_list:[]},payments_data:[],payments_form:{payment_unid:null,payment_type:"",days:"",payment_propority:"",payment_requirement:""},rebacks_data:[],rebacks_form:{reback_unid:null,actual_reback_amount:null,reback_date:"",reback_note:""},receipts_data:[],receipts_form:{receipt_unid:null,receipt_amount:null,oa_flow_id:"",receipt_note:""},add_rules:{project_unid:{required:!0,message:"不能为空",trigger:"blur"},customer_unid:{required:!0,message:"不能为空",trigger:"blur"},contract_unid:{required:!0,message:"不能为空",trigger:"blur"},contract_amount:k,deduct_amount:k,stop_amount:k,exemptions_amount:k,bad_amount:k,confirm_income_amount:k,payment_type:{required:!0,message:"类型不能为空",trigger:"blur"},days:{required:!0,pattern:/(^[1-9](\d*)$)|(^0$)/,message:"请输入正确天数",trigger:"blur"},deliver_goods_date:{validator:function(t,e,a){""==e?a(new Error("时间不能为空")):a()},trigger:"blur"},goods_acceptanc_date:{validator:function(e,a,s){""==a?s(new Error("时间不能为空")):t.delivers_form.deliver_goods_date&&a<t.delivers_form.deliver_goods_date?s(new Error("到货验收时间不能小于发货时间")):s()},trigger:"blur"}},rebacks_form_rules:{actual_reback_amount:{required:!0,validator:function(e,a,s){parseFloat(t.form.contract_amount)<parseFloat(a)?s(new Error("实际回款金额不能大于合同金额")):/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(a)?s():s(new Error("请填写正确金额"))},trigger:"blur"},reback_date:{required:!0,message:"不能为空",trigger:"blur"}},receipts_form_rules:{receipt_amount:{required:!0,validator:function(e,a,s){parseFloat(t.form.contract_amount)<parseFloat(a)?s(new Error("开票金额不能大于合同金额")):/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(a)?s():s(new Error("请填写正确金额"))},trigger:"blur"},oa_flow_id:{required:!0,message:"请输入流水号",trigger:"blur"}},acceptanc_form_rules:{acceptanc_date:{validator:function(e,a,s){"1"==t.first_acceptancs_form.acceptanc_type&&null==a?s(new Error("请填写时间")):s()},trigger:"blur"}},acceptanc_form_rules2:{acceptanc_date:{validator:function(e,a,s){"2"==t.final_acceptancs_form.acceptanc_type&&null==a?s(new Error("请填写时间")):s()},trigger:"blur"},acceptanc_type:{validator:function(e,a,s){"1"==t.first_acceptancs_form.acceptanc_type&&"2"!=a?s(new Error("初验必须终验")):s()}}}}},computed:{get_amount_state:function(){var t=this,e=(new Date).getFullYear()+"-"+((new Date).getMonth()+1)+"-"+(new Date).getDate(),a={amount_state:null,weight:-1},s={amount_state:null},o=0,n=this.form.contract_amount,r=this.total_reback_amount;return this.payments_data.forEach(function(i){var c=t;switch(i.payment_type){case"100001":c.form.sign_date&&(o+=i.payment_propority*parseFloat(n),c.date_diff(e,c.date_add_days(c.form.sign_date,i.days))>0&&o>r?(a.weight=8,"40003"!=c.form.contract_type?a.amount_state="50006":a.amount_state="50012"):"40003"!=c.form.contract_type?s.amount_state="50003":s.amount_state="50002");break;case"100002":case"100004":c.delivers_data[0]&&c.delivers_data[0].goods_acceptanc_date&&(o+=i.payment_propority*parseFloat(n),c.date_diff(e,c.date_add_days(c.delivers_data[c.delivers_data.length-1].goods_acceptanc_date,i.days))>0&&o>r?"100002"==i.payment_type&&a.weight<8?(a.weight=7,a.amount_state="50007"):a.weight<6&&(a.weight=5,a.amount_state="50009"):"100002"==i.payment_type?s.amount_state="50004":s.amount_state="50005");break;case"100003":case"100005":c.final_acceptancs_form.acceptanc_date&&(o+=i.payment_propority*parseFloat(n),c.date_diff(e,c.date_add_days(c.final_acceptancs_form.acceptanc_date,i.days))>0&&o>r?"100003"==i.payment_type&&a.weight<7?(a.weight=6,a.amount_state="50008"):a.weight<6&&(a.weight=5,a.amount_state="50009"):"100003"==i.payment_type?s.amount_state="50001":s.amount_state="50005")}}),a.weight>0?a.amount_state:s.amount_state},get_province_unid:function(){if(this.form.province_value)return this.form.province_value.split("#")[0]},get_province_name:function(){if(this.form.province_value)return this.form.province_value.split("#")[1]},get_city_unid:function(){if(this.form.city_value)return this.form.city_value.split("#")[0]},get_city_name:function(){if(this.form.city_value)return this.form.city_value.split("#")[1]},get_year:function(){if(this.form.sign_date)return this.form.sign_date.slice(0,4)},get_month:function(){if(this.form.sign_date)return this.form.sign_date.slice(5,7)},upload_url:function(){return this.contract_base_url+this.form.contract_unid+"/upload/appendixes"},contract_remaining:function(){var t=this.form.contract_amount-this.form.deduct_amount-this.total_reback_amount-this.form.stop_amount-this.form.exemptions_amount-this.form.bad_amount;return isNaN(t)?null:t.toFixed(2)},total_reback_amount:function(){for(var t=0,e=0;e<this.rebacks_data.length;e++){var a=this.rebacks_data[e];a.actual_reback_amount&&(t+=parseFloat(a.actual_reback_amount))}return t.toFixed(2)},total_receive_amount:function(){for(var t=0,e=new Date,a=e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate(),s=0;s<this.payments_data.length;s++){this.payments_data[s];this.date_diff(a,this.get_pay_date(s))>=0&&(t+=parseFloat(this.get_pay_amount(s)))}return t.toFixed(2)},total_leave_amount:function(){var t=this.total_receive_amount-this.total_reback_amount-this.form.deduct_amount-this.form.stop_amount-this.form.exemptions_amount-this.form.bad_amount;return isNaN(t)?null:t.toFixed(2)},over_days_unid:function(){for(var t="",e=new Date,a=e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate(),s=0,o=0,n=0;n<this.payments_data.length;n++){this.payments_data[n];t=this.get_pay_date(n),s+=this.get_pay_amount(n);var r=this.date_diff(a,t);r>0&&s>this.total_reback_amount&&r>o&&(o=r)}return o},start_guarantee_date:function(){if(this.guarantee_date&&this.guarantee_date[0])return this.guarantee_date[0]},end_guarantee_date:function(){if(this.guarantee_date&&this.guarantee_date[1])return this.guarantee_date[1]},mainten_start_date:function(){if("2"==this.final_acceptancs_form.acceptanc_type&&null!=this.final_acceptancs_form.acceptanc_date)return this.final_acceptancs_form.acceptanc_date},mainten_end_date:function(){if("2"==this.final_acceptancs_form.acceptanc_type&&null!=this.final_acceptancs_form.acceptanc_date)return this.date_add_month(this.final_acceptancs_form.acceptanc_date,this.form.guarantee_period)}},methods:{show_more:function(){this.hide_contract_info=!this.hide_contract_info,1==this.hide_contract_info?this.hide_text="显示更多":this.hide_text="收起",1==this.hide_contract_info?this.hide_icon="icon i-arrowdown-copy":this.hide_icon="icon i-arrowup"},download_file:function(t){window.open(t.url)},contract_upload:function(t){var e=new FormData;e.append("appendix_files",t.file),e.append("business_table","contracts");var a=new XMLHttpRequest;a.open("post",t.action,!0);var s=this;a.onerror=function(){s.$message.err("上传失败")},a.onreadystatechange=function(){if(4!=a.readyState||200!=a.status||a.response.encode)s.$message({message:"失败",type:"error"});else{var t=JSON.parse(a.response),e={};e.name=t[0].appendix_name,e.url=t[0].appendix_url,e.appendix_unid=t[0].appendix_unid,s.contract_appendix_list.push(e),s.form.appendix_unids.push(e.appendix_unid),s.$message({message:"成功",type:"success"})}},a.send(e)},delivers_upload:function(t){var e=new FormData;e.append("appendix_files",t.file),e.append("business_table","delivers");var a=new XMLHttpRequest;a.open("post",t.action,!0);var s=this;a.onerror=function(){s.$message.err("上传失败")},a.onreadystatechange=function(){if(4!=a.readyState||200!=a.status||a.response.encode)s.$message({message:"失败",type:"error"});else{var t=JSON.parse(a.response),e={};e.name=t[0].appendix_name,e.url=t[0].appendix_url,e.appendix_unid=t[0].appendix_unid,s.delivers_form.appendix_unids.push(e.appendix_unid),s.delivers_form.delivers_appendix_list.push(e),s.$message({message:"成功",type:"success"})}},a.send(e)},acceptances_upload:function(t){var e=new FormData;e.append("appendix_files",t.file),e.append("business_table","acceptance");var a=new XMLHttpRequest;a.open("post",t.action,!0);var s=this;a.onerror=function(){s.$message.err("上传失败")},a.onreadystatechange=function(){if(4!=a.readyState||200!=a.status||a.response.encode)s.$message({message:"失败",type:"error"});else{var t=JSON.parse(a.response),e={};e.name=t[0].appendix_name,e.url=t[0].appendix_url,e.appendix_unid=t[0].appendix_unid,s.final_acceptancs_form.appendix_unids.push(e.appendix_unid),s.acceptancs_appendix_list.push(e),s.$message({message:"成功",type:"success"})}},a.send(e)},first_acceptances_upload:function(t){var e=new FormData;e.append("appendix_files",t.file),e.append("business_table","acceptance");var a=new XMLHttpRequest;a.open("post",t.action,!0);var s=this;a.onerror=function(){s.$message.err("上传失败")},a.onreadystatechange=function(){if(4!=a.readyState||200!=a.status||a.response.encode)s.$message({message:"失败",type:"error"});else{var t=JSON.parse(a.response),e={};e.name=t[0].appendix_name,e.url=t[0].appendix_url,e.appendix_unid=t[0].appendix_unid,s.first_acceptancs_form.appendix_unids.push(e.appendix_unid),s.first_acceptancs_appendix_list.push(e),s.$message({message:"成功",type:"success"})}},a.send(e)},on_remove:function(t,e){this.$alert("暂时不能删除")},total_receipt_amount_cal:function(t){for(var e=0,a=t;a>=0;a--)e+=parseFloat(this.receipts_data[a].receipt_amount);return parseFloat(e).toFixed(2)},is_reback_cal:function(t){for(var e=0,a=t;a>=0;a--)e+=parseFloat(this.receipts_data[a].receipt_amount);return this.total_reback_amount>=e?"是":"否"},receipt_propority_cal:function(t){var e=0;return this.form.contract_amount&&(e=(100*this.receipts_data[t].receipt_amount/this.form.contract_amount).toFixed(2)),e},reback_propority_cal:function(t){var e=0;return this.form.contract_amount&&(e=this.rebacks_data[t].actual_reback_amount/this.form.contract_amount*100),parseFloat(e).toFixed(2)},payments_dialog_cancel:function(){this.modify_data=!1,this.payments_form={},this.payments_dialog_show=!1},rebacks_dialog_cancel:function(){this.modify_data=!1,this.rebacks_form={},this.rebacks_dialog_show=!1},receipts_dialog_cancel:function(){this.modify_data=!1,this.receipts_form={},this.receipts_dialog_show=!1},delivers_dialog_cancel:function(){this.modify_data=!1,this.delivers_form={appendix_unids:[],delivers_appendix_list:[]},this.delivers_dialog_show=!1},date_diff:function(t,e){if(t&&e){var a=t.split("-"),s=e.split("-");return parseInt((new Date(a[0],a[1]-1,a[2]).getTime()-new Date(s[0],s[1]-1,s[2]).getTime())/1e3/60/60/24)}},date_add_days:function(t,e){if(t&&null!=e){var a=new Date(t.replace(/-/g,"/"));return(a=new Date(1e3*(a/1e3+86400*e))).getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()}},date_add_month:function(t,e){if(t&&e){var a=t.split("-");return new Date(a[0],a[1]-1+e,a[2]).toLocaleDateString().match(/\d+/g).join("-")}},get_contract_unid:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"codes"}).then(function(e){t.contract_unid_selected_data=e.data}).catch(function(t){console.log(t.message)})},get_salesperson:function(){var t=this;this.$Axios({method:"get",url:this.auth_base_url+"users",params:{norm_type:"employee"}}).then(function(e){t.salesperson_unid_selected_data=e.data.list_data}).catch(function(t){console.log(t.message)})},payments_dialog_confirm:function(){var t=this;this.$refs.payments_form.validate(function(e){if(e){var a=t.payments_form.payment_unid,s=t.payments_form.payment_type;if(("100004"==s||"100005"==s)&&!t.modify_data){if(0!=t.payment_type_tag)return t.payments_form={},t.modify_data=!1,t.payments_dialog_show=!1,void t.$message.error("只能出现一次");t.payment_type_tag=1}var o={payment_unid:a,payment_type:s,days:t.payments_form.days,payment_propority:parseFloat(t.payments_form.payment_propority)/100,payment_requirement:t.payments_form.payment_requirement};t.modify_data?(o.payment_progress=t.payments_data[t.modify_index].payment_progress,t.$set(t.payments_data,t.modify_index,o)):(t.payments_data.length>0?o.payment_progress=t.payments_data[t.payments_data.length-1].payment_progress+1:o.payment_progress=1,t.payments_data.push(o)),t.payments_form={},t.modify_data=!1,t.payments_dialog_show=!1}})},receipts_dialog_confirm:function(){var t=this;this.$refs.receipts_form.validate(function(e){if(e){var a=t.receipts_form.receipt_unid,s=parseFloat(t.receipts_form.receipt_amount),o=t.receipts_form.oa_flow_id,n=t.receipts_form.receipt_note,r={receipt_unid:a,receipt_amount:parseFloat(s).toFixed(2),oa_flow_id:o,receipt_note:n};t.modify_data?(r.receipt_progress=t.receipts_data[t.modify_index].receipt_progress,t.$set(t.receipts_data,t.modify_index,r)):(t.receipts_data.length>0?r.receipt_progress=t.receipts_data[t.receipts_data.length-1].receipt_progress+1:r.receipt_progress=1,t.receipts_data.push(r)),t.modify_data=!1,t.receipts_form={},t.receipts_dialog_show=!1}})},rebacks_dialog_confirm:function(){var t=this;this.$refs.rebacks_form.validate(function(e){if(e){var a=t.rebacks_form.actual_reback_amount,s={reback_unid:t.rebacks_form.reback_unid,actual_reback_amount:a,reback_date:t.rebacks_form.reback_date,reback_note:t.rebacks_form.reback_note};t.modify_data?(s.reback_progress=t.rebacks_data[t.modify_index].reback_progress,t.$set(t.rebacks_data,t.modify_index,s)):(t.rebacks_data.length>0?s.reback_progress=t.rebacks_data[t.rebacks_data.length-1].reback_progress+1:s.reback_progress=1,t.rebacks_data.push(s)),t.modify_data=!1,t.rebacks_form={},t.rebacks_dialog_show=!1}})},delivers_dialog_confirm:function(){var t=this;this.$refs.delivers_form.validate(function(e){if(e){var a={deliver_unid:t.delivers_form.deliver_unid,deliver_goods_date:t.delivers_form.deliver_goods_date,goods_acceptanc_date:t.delivers_form.goods_acceptanc_date,appendix_unids:t.delivers_form.appendix_unids,delivers_appendix_list:t.delivers_form.delivers_appendix_list};t.modify_data?t.$set(t.delivers_data,t.modify_index,a):t.delivers_data.push(a),t.modify_data=!1,t.delivers_form={},t.delivers_dialog_show=!1}})},data_delete:function(t,e,a){var s,o,n=this;"payments"==a?(s={payment_unids:[e[t].payment_unid]},o=e[t].payment_unid):"rebacks"==a?(s={reback_unids:[e[t].reback_unid]},o=e[t].reback_unid):"receipts"==a?(s={receipt_unids:[e[t].receipt_unid]},o=e[t].receipt_unid):"delivers"==a&&(s={deliver_unids:[e[t].deliver_unid]},o=e[t].deliver_unid),this.$confirm("确认删除数据?","确认信息",{confirmButtonText:"确认",cancelButtonText:"取消"}).then(function(){null!=o?n.$Axios({method:"delete",url:n.contract_base_url+n.form.contract_unid+"/"+a,data:s}).then(function(s){"200"==s.data.ecode?(n.$message({duration:1e3,type:"success",message:"删除成功"}),"payments"!=a||"100004"!=e[t].payment_type&&"100005"!=e[t].payment_type||(n.payment_type_tag=0),e.splice(t,1),"delivers"==a&&(n.delivers_form={deliver_unid:null,deliver_goods_date:"",goods_acceptanc_date:"",appendix_unids:[],delivers_appendix_list:[]})):n.$message.error("删除失败")}):("payments"!=a||"100004"!=e[t].payment_type&&"100005"!=e[t].payment_type||(n.payment_type_tag=0),e.splice(t,1),"delivers"==a&&(n.delivers_form={deliver_unid:null,deliver_goods_date:"",goods_acceptanc_date:"",appendix_unids:[],delivers_appendix_list:[]}))}).catch(function(t){n.$message({duration:1e3,type:"info",message:"没有删除数据"})})},payment_data_modify:function(t,e){this.$set(this.payments_form,"payment_unid",e[t].payment_unid),this.$set(this.payments_form,"payment_type",e[t].payment_type),this.$set(this.payments_form,"days",e[t].days),this.$set(this.payments_form,"payment_propority",100*e[t].payment_propority),this.$set(this.payments_form,"payment_requirement",e[t].payment_requirement),this.modify_data=!0,this.modify_index=t,this.payments_dialog_show=!0},reback_data_modify:function(t,e){this.$set(this.rebacks_form,"reback_unid",e[t].reback_unid),this.$set(this.rebacks_form,"actual_reback_amount",e[t].actual_reback_amount),this.$set(this.rebacks_form,"reback_date",e[t].reback_date),this.$set(this.rebacks_form,"reback_note",e[t].reback_note),this.modify_data=!0,this.modify_index=t,this.rebacks_dialog_show=!0},receipt_data_modify:function(t,e){this.$set(this.receipts_form,"receipt_unid",e[t].receipt_unid),this.$set(this.receipts_form,"receipt_amount",parseFloat(e[t].receipt_amount).toFixed(2)),this.$set(this.receipts_form,"oa_flow_id",e[t].oa_flow_id),this.$set(this.receipts_form,"receipt_note",e[t].receipt_note),this.$set(this.receipts_form,"receipt_unid",e[t].receipt_unid),this.modify_data=!0,this.modify_index=t,this.receipts_dialog_show=!0},deliver_data_modify:function(t,e){this.delivers_form.deliver_unid=e[t].deliver_unid,this.$set(this.delivers_form,"deliver_goods_date",e[t].deliver_goods_date),this.$set(this.delivers_form,"goods_acceptanc_date",e[t].goods_acceptanc_date),this.$set(this.delivers_form,"delivers_appendix_list",e[t].delivers_appendix_list),this.$set(this.delivers_form,"appendix_unids",e[t].appendix_unids),this.modify_data=!0,this.modify_index=t,this.delivers_dialog_show=!0},get_payment_type:function(t){for(var e=0;e<this.payment_type_data.length;e++){var a=this.payment_type_data[e];if(this.payments_data[t].payment_type===a.code)return a.name}return"无"},get_payment_type_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/215649FB93/codes"}).then(function(e){t.payment_type_data=e.data.list_data}).catch(function(t){})},get_product_line_type_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/4FC51AD3C9/codes"}).then(function(e){t.product_line_type_data=e.data.list_data}).catch(function(t){})},get_contract_state_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/13BEFACBCF/codes"}).then(function(e){t.contract_state_data=e.data.list_data}).catch(function(t){})},get_contract_type_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/8EC31D08A0/codes"}).then(function(e){t.contract_type_data=e.data.list_data}).catch(function(t){})},get_amount_state_unid_data:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"custom/cates/42407C5EF2/codes"}).then(function(e){t.amount_state_unid_data=e.data.list_data}).catch(function(t){})},get_provinces:function(){var t=this;this.$Axios({method:"get",url:this.code_base_url+"countries/0E229CD043/provinces"}).then(function(e){t.provinces=e.data.list_data}).catch(function(t){console.log(t.message)})},get_cities:function(){var t=this;this.form.city_value="",this.form.province_value&&this.$Axios({method:"get",url:this.code_base_url+"countries/0E229CD043/provinces/"+this.get_province_unid+"/cities"}).then(function(e){t.cities=e.data.list_data}).catch(function(t){console.log(t.message)})},get_pay_date:function(t){var e="",a=this.payments_data[t].payment_type,s=this.payments_data[t].days;if("100001"==a&&this.form.sign_date)e=this.date_add_days(this.form.sign_date,s);else if("100002"!=a&&"100004"!=a||!this.delivers_data[0])"100003"!=a&&"100005"!=a||null==this.final_acceptancs_form.acceptanc_date||(e=this.date_add_days(this.final_acceptancs_form.acceptanc_date,s));else{var o=this.delivers_data.length-1;e=this.date_add_days(this.delivers_data[o].goods_acceptanc_date,s)}return e},get_pay_amount:function(t){var e=0;return this.form.contract_amount>0&&(e=this.form.contract_amount*this.payments_data[t].payment_propority),e},get_customers:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"customers",headers:{"Content-Type":"application/json"}}).then(function(e){t.customer_unid_selected_data=e.data}).catch(function(t){console.log(t.message)})},get_projects:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"projects",headers:{"Content-Type":"application/json"}}).then(function(e){t.project_unid_selected_data=e.data}).catch(function(t){console.log(t.message)})},get_project_info:function(t){var e=this;"0"!=t&&this.$Axios({method:"get",url:this.contract_base_url+t+"/project/acceptancs",headers:{"Content-Type":"application/json"}}).then(function(t){if(!t.data.ecode&&t.data!=[])for(var a=0;a<t.data.list_check_data.length;a++){var s=t.data.list_check_data[a];if("1"==s.acceptanc_type){if(e.$set(e.first_acceptancs_form,"acceptanc_unid",s.acceptanc_unid),e.$set(e.first_acceptancs_form,"acceptanc_type","1"),e.$set(e.first_acceptancs_form,"acceptanc_date",s.acceptanc_date),e.$set(e.first_acceptancs_form,"acceptanc_note",s.acceptanc_note),e.first_acceptancs_appendix_list=[],s.appendix_list)for(var o=0;o<s.appendix_list.length;o++){var n=s.appendix_list[o];(i={}).name=n.appendix_name,i.url=n.appendix_url,e.first_acceptancs_appendix_list.push(i)}}else if("2"==s.acceptanc_type&&(e.$set(e.final_acceptancs_form,"acceptanc_unid",s.acceptanc_unid),e.$set(e.final_acceptancs_form,"acceptanc_type","2"),e.$set(e.final_acceptancs_form,"acceptanc_date",s.acceptanc_date),e.$set(e.final_acceptancs_form,"acceptanc_note",s.acceptanc_note),e.final_acceptancs_form,e.acceptancs_appendix_list=[],s.appendix_list))for(var r=0;r<s.appendix_list.length;r++){var i,c=s.appendix_list[r];(i={}).name=c.appendix_name,i.url=c.appendix_url,e.acceptancs_appendix_list.push(i)}}}).catch(function(t){console.log(t.message)})},get_payment_info:function(t){var e=this;"0"!=t&&this.$Axios({method:"get",url:this.contract_base_url+t+"/payments",headers:{"Content-Type":"application/json"}}).then(function(t){if(!t.data.ecode||t.data!=[])for(var a=0;a<t.data.length;a++){var s={},o=t.data[a];s.payment_unid=o.payment_unid,s.payment_type=o.payment_type?o.payment_type:"","100004"!=s.payment_type&&"100005"!=s.payment_type||(e.payment_type_tag=1),s.payment_progress=o.payment_progress,s.days=o.days?o.days:0,s.payment_propority=o.payment_propority?o.payment_propority:0,s.payment_requirement=o.payment_requirement?o.payment_requirement:"",s.amount=e.form.contract_amount*s.payment_propority,e.payments_data.push(s)}}).catch(function(t){console.log(t.message)})},get_deliver_info:function(t){var e=this;"0"!=t&&this.$Axios({method:"get",url:this.contract_base_url+t+"/delivers",headers:{"Content-Type":"application/json"}}).then(function(t){if("500"!=t.data.ecode&&t.data!=[])for(var a=0;a<t.data.list_deliver_data.length;a++){var s=t.data.list_deliver_data[a],o={};o.deliver_unid=s.deliver_unid,o.deliver_goods_date=s.deliver_goods_date?s.deliver_goods_date:"",o.goods_acceptanc_date=s.goods_acceptanc_date?s.goods_acceptanc_date:"",o.delivers_appendix_list=[],o.appendix_unids=[];for(var n=0;n<s.list_deliver_data.length;n++){var r=s.list_deliver_data[n],i={};i.name=r.appendix_name,i.url=r.appendix_url,i.id=r.appendix_unid,o.delivers_appendix_list.push(i)}e.delivers_data.push(o)}}).catch(function(t){console.log(t.message)})},get_reback_info:function(t){var e=this;"0"!=t&&this.$Axios({method:"get",url:this.contract_base_url+t+"/rebacks",headers:{"Content-Type":"application/json"}}).then(function(t){if(!t.data.ecode||t.data!=[])for(var a=0;a<t.data.length;a++){var s=t.data[a],o={};o.reback_unid=s.reback_unid,o.reback_progress=s.reback_progress,o.reback_date=s.reback_date?s.reback_date:"",o.actual_reback_amount=s.actual_reback_amount?parseFloat(s.actual_reback_amount).toFixed(2):null,o.reback_note=s.reback_note?s.reback_note:"",e.rebacks_data.push(o)}}).catch(function(t){console.log(t.message)})},get_receipt_info:function(t){var e=this;"0"!=t&&this.$Axios({method:"get",url:this.contract_base_url+t+"/receipts",headers:{"Content-Type":"application/json"}}).then(function(t){if(!t.data.ecode||t.data!=[])for(var a=0;a<t.data.length;a++){var s=t.data[a],o={};o.receipt_unid=s.receipt_unid,o.oa_flow_id=s.oa_flow_id?s.oa_flow_id:null,o.receipt_amount=s.receipt_amount?parseFloat(s.receipt_amount).toFixed(2):0,o.receipt_note=s.receipt_note?s.receipt_note:"",o.receipt_progress=s.receipt_progress,e.receipts_data.push(o)}}).catch(function(t){console.log(t.message)})},get_contract_info:function(t){var e=this;this.$Axios({method:"get",url:this.contract_base_url+t,headers:{"Content-Type":"application/json"}}).then(function(t){if("100"==t.data.ecode)e.$alert("合同已删除"),e.$router.push({path:"0"});else{if(e.$set(e.form,"contract_unid",t.data.contract_unid),t.data.province?e.$set(e.form,"province_value",t.data.province+"#"+t.data.province_name):t.data.province_name&&e.provinces.forEach(function(a){a.name===t.data.province_name&&e.$set(e.form,"province_value",a.province_unid+"#"+t.data.province_name)}),t.data.city?(e.get_cities(),e.$set(e.form,"city_value",t.data.city+"#"+t.data.city_name)):t.data.city_name&&e.form.province_value&&e.$Axios({method:"get",url:e.code_base_url+"countries/0E229CD043/provinces/"+e.get_province_unid+"/cities"}).then(function(a){e.cities=a.data.list_data,e.cities.forEach(function(a){a.name===t.data.city_name&&e.$set(e.form,"city_value",a.city_unid+"#"+t.data.city_name)})}).catch(function(t){console.log(t.message)}),t.data.contract_state&&e.$set(e.form,"contract_state",t.data.contract_state),t.data.contract_type&&e.$set(e.form,"contract_type",t.data.contract_type),t.data.is_archive&&e.$set(e.form,"is_archive",t.data.is_archive),t.data.amount_state_unid&&e.$set(e.form,"amount_state_unid",t.data.amount_state_unid),t.data.salesperson_unid&&e.$set(e.form,"salesperson_unid",t.data.salesperson_unid),t.data.project_unid&&e.$set(e.form,"project_unid",t.data.project_unid),t.data.customer_unid&&e.$set(e.form,"customer_unid",t.data.customer_unid),t.data.deduct_amount&&e.$set(e.form,"deduct_amount",t.data.deduct_amount.toFixed(2)),t.data.contract_amount_note&&e.$set(e.form,"contract_amount_note",t.data.contract_amount_note),t.data.stop_amount&&e.$set(e.form,"stop_amount",t.data.stop_amount.toFixed(2)),t.data.reback_note&&e.$set(e.form,"reback_note",t.data.reback_note),t.data.exemptions_amount&&e.$set(e.form,"exemptions_amount",t.data.exemptions_amount.toFixed(2)),t.data.contract_remain_note&&e.$set(e.form,"contract_remain_note",t.data.contract_remain_note),t.data.bad_amount_note&&e.$set(e.form,"bad_amount_note",t.data.bad_amount_note),t.data.contract_note&&e.$set(e.form,"contract_note",t.data.contract_note),t.data.contract_amount&&e.$set(e.form,"contract_amount",t.data.contract_amount.toFixed(2)),t.data.guarantee_period&&e.$set(e.form,"guarantee_period",t.data.guarantee_period),t.data.product_line_type&&e.$set(e.form,"product_line_type",t.data.product_line_type),t.data.confirm_income_amount&&e.$set(e.form,"confirm_income_amount",t.data.confirm_income_amount.toFixed(2)),t.data.sign_date&&e.$set(e.form,"sign_date",t.data.sign_date),t.data.bad_amount&&e.$set(e.form,"bad_amount",t.data.bad_amount.toFixed(2)),e.contract_appendix_list=[],t.data.appendix_list)for(var a=0;a<t.data.appendix_list.length;a++){var s=t.data.appendix_list[a],o={};o.name=s.appendix_name,o.url=s.appendix_url,o.id=s.appendix_unid,e.contract_appendix_list.push(o)}e.form.start_guarantee_date&&e.$delete(e.form,"start_guarantee_date"),e.form.end_guarantee_date&&e.$delete(e.form,"end_guarantee_date"),e.guarantee_date=[],t.data.start_guarantee_date?e.guarantee_date.push(t.data.start_guarantee_date):e.guarantee_date.push(""),t.data.end_guarantee_date?e.guarantee_date.push(t.data.end_guarantee_date):e.guarantee_date.push("")}}).catch(function(t){console.log(t.message)})},get_all:function(t){this.get_contract_info(t),this.get_deliver_info(t),this.get_reback_info(t),this.get_receipt_info(t),this.get_payment_info(t),this.get_project_info(t)},form_submit:function(t){var e=this,a=this.form;v()(a).forEach(function(t){a[t]&&"string"==typeof a[t]&&(console.log(a[t]),a[t]=a[t].trim())});var s=this.$route.params.contract_unid;switch(t){case"form":this.$refs.contract_form.validate(function(t){t&&(e.form.start_guarantee_date=e.start_guarantee_date,e.form.end_guarantee_date=e.end_guarantee_date,e.form.province=e.get_province_unid,e.form.province_name=e.get_province_name,e.form.city=e.get_city_unid,e.form.city_name=e.get_city_name,e.$Axios({method:"put",url:e.contract_base_url+e.form.contract_unid,data:e.form,headers:{"Content-Type":"application/json"}}).then(function(t){200==t.data.ecode?e.$message({type:"success",message:"提交成功"}):e.$message.error("提交失败"),e.$refs.contract_form.resetFields(),e.get_contract_info(s)}).catch(function(t){e.$message.error("提交失败")}))}),this.form_submit("payment");break;case"payment":for(var o=function(t){var a=e.payments_data[t];null!=a.payment_unid?e.$Axios({method:"put",url:e.contract_base_url+e.form.contract_unid+"/payments",data:{list_payment_data:[a]}}).then(function(a){"500"==a.data.ecode?e.$message.error("提交失败"):e.$message({type:"success",message:"提交成功"}),t==e.payments_data.length-1&&(e.payments_data=[],e.get_payment_info(s))}).catch(function(t){console.log(t.message),e.$message.error("提交失败")}):e.$Axios({method:"post",url:e.contract_base_url+e.form.contract_unid+"/payments",data:{list_payment_data:[a]}}).then(function(a){"500"==a.data.ecode?e.$message.error("提交失败"):e.$message({type:"success",message:"提交成功"}),t==e.payments_data.length-1&&(e.payments_data=[],e.get_payment_info(s))}).catch(function(t){e.$message.error("提交失败"),console.log(t.message)})},n=0;n<this.payments_data.length;n++)o(n);break;case"reback":a=0;var r=function(t){var a=e.rebacks_data[t];null!=a.reback_unid?e.$Axios({method:"put",url:e.contract_base_url+e.form.contract_unid+"/rebacks",data:{list_reback_data:[a]},headers:{"Content-Type":"application/json"}}).then(function(a){"500"==a.data.ecode?e.$message.error("提交失败"):e.$message({type:"success",message:"提交成功"}),t==e.rebacks_data.length-1&&(e.rebacks_data=[],e.get_reback_info(s))}).catch(function(t){console.log(t.message),e.$message.error("提交失败")}):e.$Axios({method:"post",url:e.contract_base_url+e.form.contract_unid+"/rebacks",data:{list_reback_data:[a]},headers:{"Content-Type":"application/json"}}).then(function(a){"500"==a.data.ecode?e.$message.error("提交失败"):e.$message({type:"success",message:"提交成功"}),t==e.rebacks_data.length-1&&(e.rebacks_data=[],e.get_reback_info(s))}).catch(function(t){console.log(t.message),e.$message.error("提交失败")})};for(n=0;n<this.rebacks_data.length;n++)r(n);break;case"receipt":a=0;var i=function(t){var a=e.receipts_data[t];null!=a.receipt_unid?e.$Axios({method:"put",url:e.contract_base_url+e.form.contract_unid+"/receipts",data:{list_receipt_data:[a]},headers:{"Content-Type":"application/json"}}).then(function(a){"500"==a.data.ecode?e.$message.error("提交失败"):e.$message({type:"success",message:"提交成功"}),t==e.receipts_data.length-1&&(e.receipts_data=[],e.get_receipt_info(s))}).catch(function(t){console.log(t.message),e.$message.error("提交失败")}):e.$Axios({method:"post",url:e.contract_base_url+e.form.contract_unid+"/receipts",data:{list_receipt_data:[a]},headers:{"Content-Type":"application/json"}}).then(function(a){"500"==a.data.ecode?e.$message.error("提交失败"):e.$message({type:"success",message:"提交成功"}),t==e.receipts_data.length-1&&(e.receipts_data=[],e.get_receipt_info(s))}).catch(function(t){console.log(t.message),e.$message.error("提交失败")})};for(n=0;n<this.receipts_data.length;n++)i(n);break;case"deliver":a=0;var c=function(t){var a=e.delivers_data[t];a.deliver_unid?e.$Axios({method:"put",url:e.contract_base_url+e.form.contract_unid+"/delivers",data:{list_deliver_data:[a]},headers:{"Content-Type":"application/json"}}).then(function(a){"500"==a.data.ecode?e.$message.error("提交失败"):e.$message({type:"success",message:"提交成功"}),t==e.delivers_data.length-1&&(e.delivers_data=[],e.get_deliver_info(s))}).catch(function(t){e.$message.error("提交失败")}):e.$Axios({method:"post",url:e.contract_base_url+e.form.contract_unid+"/delivers",data:{list_deliver_data:[a]},headers:{"Content-Type":"application/json"}}).then(function(a){"500"==a.data.ecode?e.$message.error("提交失败"):e.$message({type:"success",message:"提交成功"}),t==e.delivers_data.length-1&&(e.delivers_data=[],e.get_deliver_info(s))}).catch(function(t){console.log(t.message),e.$message.error("提交失败")})};for(n=0;n<this.delivers_data.length;n++)c(n);break;case"project":a=0;this.$refs.first_acceptancs_form.validate(function(t){t&&e.$refs.final_acceptancs_form.validate(function(t){var a,o;t&&(a=""!=e.first_acceptancs_form.acceptanc_unid?"put":"post",""==e.first_acceptancs_form.acceptanc_type?""!=e.first_acceptancs_form.acceptanc_unid&&e.$Axios({method:"DELETE",url:e.contract_base_url+e.form.contract_unid+"/project/acceptancs",data:{acceptanc_unids:[e.first_acceptancs_form.acceptanc_unid]}}).then(function(t){console.log(t.data)}).catch():e.$Axios({method:a,url:e.contract_base_url+e.form.contract_unid+"/project/acceptancs",data:{list_check_data:[e.first_acceptancs_form]},headers:{"Content-Type":"application/json"}}).then(function(t){if("500"==t.data.ecode)return e.$message.error("提交失败"),e.$refs.first_acceptancs_form.resetFields(),e.$refs.final_acceptancs_form.resetFields(),void e.get_project_info(s)}).catch(function(t){e.$message.error("提交失败")}),o=""!=e.final_acceptancs_form.acceptanc_unid?"put":"post",""==e.final_acceptancs_form.acceptanc_type?""!=e.final_acceptancs_form.acceptanc_unid&&e.$Axios({method:"DELETE",url:e.contract_base_url+e.form.contract_unid+"/project/acceptancs",data:{acceptanc_unids:[e.final_acceptancs_form.acceptanc_unid]}}).then(function(t){console.log(t.data),e.$refs.first_acceptancs_form.resetFields(),e.$refs.final_acceptancs_form.resetFields(),e.get_project_info(s)}).catch():e.$Axios({method:o,url:e.contract_base_url+e.form.contract_unid+"/project/acceptancs",data:{list_check_data:[e.final_acceptancs_form]},headers:{"Content-Type":"application/json"}}).then(function(t){"500"==t.data.ecode?e.$message.error("提交失败"):(e.$message({type:"success",message:"提交成功"}),e.$refs.first_acceptancs_form.resetFields(),e.$refs.final_acceptancs_form.resetFields(),e.get_project_info(s))}).catch(function(t){e.$message.error("提交失败")}))})})}},change_unid:function(t){this.$router.push(""+t)},change_dialog:function(){if(localStorage.getItem("style"))for(var t=JSON.parse(localStorage.getItem("style")),e=document.getElementsByClassName("el-dialog"),a=0;a<e.length;a++){var s=e[a];s.style.backgroundColor=t.color,s.style.backgroundImage=t.image}}},created:function(){if("null"!=sessionStorage.getItem("user_roles")&&sessionStorage.getItem("user_roles"))for(var t=JSON.parse(sessionStorage.getItem("user_roles")),e=0;e<t.length;e++){var a=t[e];"ec480894ee85f1fa282ee7fa27be9cbc"==a.role_unid?this.disabled_list[2]=0:"91d5185d47e3bad099e17570b0dd0ed2"==a.role_unid?this.disabled_list=[0,0,0,0]:"65f881ffa510eb9ec0c0dc76d625515f"==a.role_unid?this.disabled_list[3]=0:"b126ebb9fbc87f4997cb0498a88b5f4c"==a.role_unid&&(this.disabled_list[1]=0,this.hide_contract_info=!1)}sessionStorage.getItem("manager")&&(this.disabled_list=[0,0,0,0]),sessionStorage.getItem("provinces")?this.provinces=JSON.parse(sessionStorage.getItem("provinces")):this.get_provinces(),sessionStorage.getItem("contract_state_data")?this.contract_state_data=JSON.parse(sessionStorage.getItem("contract_state_data")):this.get_contract_state_data(),sessionStorage.getItem("contract_type_data")?this.contract_type_data=JSON.parse(sessionStorage.getItem("contract_type_data")):this.get_contract_type_data(),sessionStorage.getItem("amount_state_unid_data")?this.amount_state_unid_data=JSON.parse(sessionStorage.getItem("amount_state_unid_data")):this.get_amount_state_unid_data(),sessionStorage.getItem("product_line_type_data")?this.product_line_type_data=JSON.parse(sessionStorage.getItem("product_line_type_data")):this.get_product_line_type_data(),sessionStorage.getItem("payment_type_data")?this.payment_type_data=JSON.parse(sessionStorage.getItem("payment_type_data")):this.get_payment_type_data(),sessionStorage.getItem("salesperson_unid_selected_data")?this.salesperson_unid_selected_data=JSON.parse(sessionStorage.getItem("salesperson_unid_selected_data")):this.get_salesperson(),sessionStorage.getItem("contract_unid_selected_data")?this.contract_unid_selected_data=JSON.parse(sessionStorage.getItem("contract_unid_selected_data")):this.get_contract_unid(),sessionStorage.getItem("project_unid_selected_data")?this.project_unid_selected_data=JSON.parse(sessionStorage.getItem("project_unid_selected_data")):this.get_projects(),sessionStorage.getItem("customer_unid_selected_data")?this.customer_unid_selected_data=JSON.parse(sessionStorage.getItem("customer_unid_selected_data")):this.get_customers();var s=this.$route.params.contract_unid;0!=s&&this.get_all(s),sessionStorage.getItem("modify")?this.contract_unid_disabled=!0:(this.contract_unid_disabled=!1,this.$message({type:"warning",message:"请选择合同编号,再进行下一步操作",duration:5e3}))},mounted:function(){this.change_dialog()},watch:{$route:function(t,e){this.payments_data=[],this.rebacks_data=[],this.receipts_data=[],this.delivers_data=[],this.$refs.first_acceptancs_form.resetFields(),this.$refs.final_acceptancs_form.resetFields(),this.$refs.contract_form.resetFields(),0!=t.params.contract_unid?this.get_all(t.params.contract_unid):this.contract_unid_disabled=!1}}},S={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"contract_info"}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"},on:{click:function(e){t.contract_show=!t.contract_show}}},[t._v("合同基本信息")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1!=t.disabled_list[0]||1!=t.disabled_list[1],expression:"disabled_list[0]!=1 || disabled_list[1] != 1"}],staticStyle:{float:"right",padding:"8px 0",color:"#c9cabb"},attrs:{type:"text"},on:{click:function(e){t.form_submit("form")}}},[t._v("提交")])],1),t._v(" "),a("transition",{attrs:{name:"el-fade-in-linear"}},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:t.contract_show,expression:"contract_show"}],ref:"contract_form",staticClass:"demo-form-inline",attrs:{id:"form",inline:!0,model:t.form,"label-width":"100px",rules:t.add_rules}},[a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"合同编号",prop:"contract_unid"}},[a("el-select",{staticClass:"width-220",attrs:{id:"ccc",filterable:"",placeholder:"合同编号",disabled:t.contract_unid_disabled},on:{change:function(e){t.change_unid(t.form.contract_unid)}},model:{value:t.form.contract_unid,callback:function(e){t.$set(t.form,"contract_unid",e)},expression:"form.contract_unid"}},t._l(t.contract_unid_selected_data,function(t,e){return a("el-option",{key:e,attrs:{label:t,value:t}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"销售员",prop:"salesperson_unid"}},[a("el-select",{staticClass:"width-220",attrs:{clearable:"",filterable:"",placeholder:"销售人员",disabled:1==t.disabled_list[0]},model:{value:t.form.salesperson_unid,callback:function(e){t.$set(t.form,"salesperson_unid",e)},expression:"form.salesperson_unid"}},t._l(t.salesperson_unid_selected_data,function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.user_unid}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"项目名称",prop:"project_unid"}},[a("el-select",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0],clearable:"",filterable:"",placeholder:"项目名称"},model:{value:t.form.project_unid,callback:function(e){t.$set(t.form,"project_unid",e)},expression:"form.project_unid"}},t._l(t.project_unid_selected_data,function(t,e){return a("el-option",{key:e,attrs:{label:t.project_name,value:t.project_unid}})}))],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"客户名称",prop:"customer_unid"}},[a("el-select",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0],clearable:"",filterable:"",placeholder:"客户名称"},model:{value:t.form.customer_unid,callback:function(e){t.$set(t.form,"customer_unid",e)},expression:"form.customer_unid"}},t._l(t.customer_unid_selected_data,function(t){return a("el-option",{key:t.customer_unid,attrs:{label:t.customer_name,value:t.customer_unid}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{id:"province",label:"项目所在地",prop:"province_value"}},[a("el-select",{staticStyle:{width:"108px"},attrs:{disabled:1==t.disabled_list[0],filterable:"",clearable:"",placeholder:"省"},on:{change:function(e){t.get_cities()}},model:{value:t.form.province_value,callback:function(e){t.$set(t.form,"province_value",e)},expression:"form.province_value"}},t._l(t.provinces,function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.province_unid+"#"+t.name}})}))],1),t._v(" "),a("el-form-item",{attrs:{prop:"city_value"}},[a("el-select",{staticStyle:{width:"108px"},attrs:{disabled:1==t.disabled_list[0],filterable:"",clearable:"",placeholder:"市"},model:{value:t.form.city_value,callback:function(e){t.$set(t.form,"city_value",e)},expression:"form.city_value"}},t._l(t.cities,function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.city_unid+"#"+t.name}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"质保周期(月)",prop:"guarantee_period"}},[a("el-input-number",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0],step:6,min:6,max:60,size:"medium"},model:{value:t.form.guarantee_period,callback:function(e){t.$set(t.form,"guarantee_period",e)},expression:"form.guarantee_period"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"签订日期",prop:"sign_date"}},[a("el-date-picker",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0],type:"date",placeholder:"日期","value-format":"yyyy-MM-dd"},model:{value:t.form.sign_date,callback:function(e){t.$set(t.form,"sign_date",e)},expression:"form.sign_date"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"所属年份"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:!0},model:{value:t.get_year,callback:function(e){t.get_year=e},expression:"get_year"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"所属月份"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:!0},model:{value:t.get_month,callback:function(e){t.get_month=e},expression:"get_month"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"产品线类型",prop:"product_line_type"}},[a("el-select",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0],clearable:"",placeholder:"产品线类型"},model:{value:t.form.product_line_type,callback:function(e){t.$set(t.form,"product_line_type",e)},expression:"form.product_line_type"}},t._l(t.product_line_type_data,function(t){return a("el-option",{key:t.unid,attrs:{label:t.name,value:t.code}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"合同金额",prop:"contract_amount"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0],clearable:""},model:{value:t.form.contract_amount,callback:function(e){t.$set(t.form,"contract_amount",e)},expression:"form.contract_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"合同性质",prop:"contract_type"}},[a("el-select",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0],clearable:"",placeholder:"合同性质"},model:{value:t.form.contract_type,callback:function(e){t.$set(t.form,"contract_type",e)},expression:"form.contract_type"}},t._l(t.contract_type_data,function(t){return a("el-option",{key:t.unid,attrs:{label:t.name,value:t.code}})}))],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"维保服务期",prop:"guarantee_date"}},[a("el-date-picker",{staticStyle:{width:"220px",padding:"0 0 0 10px"},attrs:{disabled:1==t.disabled_list[0],type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd","unlink-panels":!0},model:{value:t.guarantee_date,callback:function(e){t.guarantee_date=e},expression:"guarantee_date"}})],1)],1),t._v(" "),a("el-col",{staticStyle:{"text-align":"left"},attrs:{span:15}},[a("el-form-item",{attrs:{label:"质保期"}},[a("el-date-picker",{attrs:{type:"date",placeholder:"开始日期","value-format":"yyyy-MM-dd",disabled:!0},model:{value:this.mainten_start_date,callback:function(e){t.$set(this,"mainten_start_date",e)},expression:"this.mainten_start_date"}}),t._v(" "),a("el-date-picker",{attrs:{type:"date",placeholder:"结束日期","value-format":"yyyy-MM-dd",disabled:!0},model:{value:this.mainten_end_date,callback:function(e){t.$set(this,"mainten_end_date",e)},expression:"this.mainten_end_date"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"备注",prop:"contract_note"}},[a("el-input",{staticStyle:{width:"220px"},attrs:{disabled:1==t.disabled_list[0],type:"textarea",rows:5},model:{value:t.form.contract_note,callback:function(e){t.$set(t.form,"contract_note",e)},expression:"form.contract_note"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:9}},[a("el-form-item",{attrs:{label:"上传文件",prop:"contract_appendix_list"}},[a("el-upload",{staticClass:"upload-demo",attrs:{disabled:1==t.disabled_list[0],action:t.upload_url,multiple:"","file-list":t.contract_appendix_list,"http-request":t.contract_upload,"on-preview":t.download_file,"on-remove":t.on_remove}},[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"上传后点击提交按钮生效",placement:"top"}},[a("el-button",{staticStyle:{width:"200px"},attrs:{disabled:1==t.disabled_list[0],type:"primary"}},[t._v("点击上传")])],1)],1)],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"margin-bottom":"10px"},attrs:{id:"hide_wrapper"}},[a("span",{attrs:{id:"hide_icon_text"},on:{click:t.show_more}},[t._v("-------\n            "),a("i",{class:t.hide_icon},[t._v(t._s(t.hide_text))]),t._v("  -------")])]),t._v(" "),a("el-collapse-transition",[a("div",{directives:[{name:"show",rawName:"v-show",value:!t.hide_contract_info,expression:"!hide_contract_info"}],attrs:{id:"contract_hide"}},[a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"合同状态",prop:"contract_state"}},[a("el-select",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:"",placeholder:"合同状态"},model:{value:t.form.contract_state,callback:function(e){t.$set(t.form,"contract_state",e)},expression:"form.contract_state"}},t._l(t.contract_state_data,function(t){return a("el-option",{key:t.unid,attrs:{label:t.name,value:t.code}})}))],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"抵扣金额",prop:"deduct_amount"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.deduct_amount,callback:function(e){t.$set(t.form,"deduct_amount",e)},expression:"form.deduct_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"备注",prop:"contract_amount_note"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.contract_amount_note,callback:function(e){t.$set(t.form,"contract_amount_note",e)},expression:"form.contract_amount_note"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"累计回款额"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:!0,clearable:""},model:{value:t.total_reback_amount,callback:function(e){t.total_reback_amount=e},expression:"total_reback_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"暂停金额",prop:"stop_amount"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.stop_amount,callback:function(e){t.$set(t.form,"stop_amount",e)},expression:"form.stop_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"备注",prop:"reback_note"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.reback_note,callback:function(e){t.$set(t.form,"reback_note",e)},expression:"form.reback_note"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"合同余额"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:!0},model:{value:t.contract_remaining,callback:function(e){t.contract_remaining=e},expression:"contract_remaining"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"豁免金额",prop:"exemptions_amount"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.exemptions_amount,callback:function(e){t.$set(t.form,"exemptions_amount",e)},expression:"form.exemptions_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"备注",prop:"contract_remain_note"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.contract_remain_note,callback:function(e){t.$set(t.form,"contract_remain_note",e)},expression:"form.contract_remain_note"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"合同是否归档",prop:"is_archive"}},[a("el-select",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:"",placeholder:"请选择"},model:{value:t.form.is_archive,callback:function(e){t.$set(t.form,"is_archive",e)},expression:"form.is_archive"}},[a("el-option",{attrs:{label:"是",value:!0}}),t._v(" "),a("el-option",{attrs:{label:"否",value:!1}})],1)],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"坏账金额",prop:"bad_amount"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.bad_amount,callback:function(e){t.$set(t.form,"bad_amount",e)},expression:"form.bad_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"备注",prop:"bad_amount_note"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.bad_amount_note,callback:function(e){t.$set(t.form,"bad_amount_note",e)},expression:"form.bad_amount_note"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"累计应收款"}},[a("el-input",{staticClass:"width-220",attrs:{id:"total_receive_amount",disabled:!0},model:{value:t.total_receive_amount,callback:function(e){t.total_receive_amount=e},expression:"total_receive_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"应收账款余额"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:!0},model:{value:t.total_leave_amount,callback:function(e){t.total_leave_amount=e},expression:"total_leave_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"逾期天数"}},[a("el-input",{staticClass:"width-220",attrs:{id:"over_days",disabled:!0},model:{value:t.over_days_unid,callback:function(e){t.over_days_unid=e},expression:"over_days_unid"}})],1)],1)],1),t._v(" "),a("el-row",{staticStyle:{"text-align":"left"}},[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"确认收入金额",prop:"confirm_income_amount"}},[a("el-input",{staticClass:"width-220",attrs:{disabled:1==t.disabled_list[0]&&1==t.disabled_list[1],clearable:""},model:{value:t.form.confirm_income_amount,callback:function(e){t.$set(t.form,"confirm_income_amount",e)},expression:"form.confirm_income_amount"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"账款状态",prop:"amount_state_unid"}},[a("el-select",{staticClass:"width-220",attrs:{disabled:!0,clearable:"",placeholder:"账款状态"},model:{value:t.get_amount_state,callback:function(e){t.get_amount_state=e},expression:"get_amount_state"}},t._l(t.amount_state_unid_data,function(t){return a("el-option",{key:t.unid,attrs:{label:t.name,value:t.code}})}))],1)],1)],1)],1)])],1)],1)],1),t._v(" "),a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"},on:{click:function(e){t.payments_show=!t.payments_show}}},[t._v("付款约定")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],staticStyle:{float:"right",padding:"8px 0",color:"#c9cabb"},attrs:{type:"text"},on:{click:function(e){t.form_submit("payment")}}},[t._v("提交")])],1),t._v(" "),a("transition",{attrs:{name:"el-fade-in-linear"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.payments_show,expression:"payments_show"}],attrs:{id:"payments_data_table"}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.payments_data}},[a("el-table-column",{attrs:{prop:"payment_progress",label:"付款进度","min-width":"80",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"付款类型","min-width":"120",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(t.get_payment_type(e.$index))+"\n            ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"days",label:"天数","min-width":"80",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"付款比例(%)","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(100*t.payments_data[e.$index].payment_propority)+"\n            ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"本期应付款日期","min-width":"120",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(t.get_pay_date(e.$index))+"\n            ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"amount",label:"本期应付款金额","min-width":"120",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(t.get_pay_amount(e.$index).toFixed(2))+"\n            ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"payment_requirement",label:"本期付款条件","min-width":"300",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作",width:"140",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button-group",[a("el-button",{attrs:{type:"primary",size:"mini",round:"",disabled:1==t.disabled_list[0]},nativeOn:{click:function(a){a.preventDefault(),t.payment_data_modify(e.$index,t.payments_data)}}},[t._v("\n                  修改\n                ")]),t._v(" "),a("el-button",{attrs:{type:"danger",size:"mini",round:"",disabled:1==t.disabled_list[0]},nativeOn:{click:function(a){a.preventDefault(),t.data_delete(e.$index,t.payments_data,"payments")}}},[t._v("\n                  移除\n                ")])],1)]}}])})],1),t._v(" "),a("el-row",[a("el-button",{staticClass:"add_button",attrs:{type:"text",disabled:1==t.disabled_list[0]},on:{click:function(e){t.payments_dialog_show=!0}}},[t._v("添加付款约定")])],1)],1)])],1),t._v(" "),a("el-dialog",{attrs:{id:"payments_dialog",title:"付款约定",visible:t.payments_dialog_show,width:"30%","show-close":!1},on:{"update:visible":function(e){t.payments_dialog_show=e}}},[a("el-form",{ref:"payments_form",attrs:{model:t.payments_form,"label-width":"150px","label-position":"left",rules:t.add_rules}},[a("el-form-item",{attrs:{label:"付款类型",prop:"payment_type"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"付款类型"},model:{value:t.payments_form.payment_type,callback:function(e){t.$set(t.payments_form,"payment_type",e)},expression:"payments_form.payment_type"}},t._l(t.payment_type_data,function(t){return a("el-option",{key:t.unid,attrs:{label:t.name,value:t.code}})}))],1),t._v(" "),a("el-form-item",{attrs:{label:"天数",prop:"days"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入天数",clearable:""},model:{value:t.payments_form.days,callback:function(e){t.$set(t.payments_form,"days",e)},expression:"payments_form.days"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"付款比例",prop:"payment_propority"}},[a("el-input-number",{staticStyle:{width:"100%"},attrs:{step:5,min:0,max:100},model:{value:t.payments_form.payment_propority,callback:function(e){t.$set(t.payments_form,"payment_propority",e)},expression:"payments_form.payment_propority"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"条件",prop:"payment_requirement"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{type:"textarea",rows:2},model:{value:t.payments_form.payment_requirement,callback:function(e){t.$set(t.payments_form,"payment_requirement",e)},expression:"payments_form.payment_requirement"}})],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.payments_dialog_cancel()}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.payments_dialog_confirm()}}},[t._v("确 定")])],1)],1),t._v(" "),a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"},on:{click:function(e){t.acceptanc_show=!t.acceptanc_show}}},[t._v("工程验收信息(工程部)")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1!=t.disabled_list[3],expression:"disabled_list[3]!=1"}],staticStyle:{float:"right",padding:"8px 0",color:"#c9cabb"},attrs:{type:"text"},on:{click:function(e){t.form_submit("project")}}},[t._v("提交")])],1),t._v(" "),a("transition",{attrs:{name:"el-fade-in-linear"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.acceptanc_show,expression:"acceptanc_show"}],attrs:{id:"acceptanc_form"}},[a("el-form",{ref:"first_acceptancs_form",staticClass:"demo-form-inline",attrs:{inline:!0,model:t.first_acceptancs_form,"label-width":"100px",rules:t.acceptanc_form_rules,disabled:1==t.disabled_list[3]}},[a("el-row",[a("el-col",{attrs:{span:8}},[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"填写初验必须填写终验",placement:"top"}},[a("el-form-item",{attrs:{label:"是否初验",prop:"acceptanc_type"}},[a("el-select",{staticClass:"width-220",attrs:{clearable:""},model:{value:t.first_acceptancs_form.acceptanc_type,callback:function(e){t.$set(t.first_acceptancs_form,"acceptanc_type",e)},expression:"first_acceptancs_form.acceptanc_type"}},[a("el-option",{attrs:{label:"是",value:"1"}}),t._v(" "),a("el-option",{attrs:{label:"否",value:""}})],1)],1)],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"项目验收日期",prop:"acceptanc_date"}},[a("el-date-picker",{staticClass:"width-220",attrs:{type:"date","value-format":"yyyy-MM-dd"},model:{value:t.first_acceptancs_form.acceptanc_date,callback:function(e){t.$set(t.first_acceptancs_form,"acceptanc_date",e)},expression:"first_acceptancs_form.acceptanc_date"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"备注"}},[a("el-input",{staticClass:"width-220",attrs:{type:"textarea",rows:2,placeholder:"备注",clearable:""},model:{value:t.first_acceptancs_form.acceptanc_note,callback:function(e){t.$set(t.first_acceptancs_form,"acceptanc_note",e)},expression:"first_acceptancs_form.acceptanc_note"}})],1)],1)],1),t._v(" "),a("el-row",[a("el-form-item",{attrs:{lalel:"上传附件"}},[a("el-upload",{staticClass:"upload-demo",attrs:{action:t.upload_url,multiple:"","file-list":t.first_acceptancs_appendix_list,"http-request":t.first_acceptances_upload,"on-preview":t.download_file,"on-remove":t.on_remove}},[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"上传后点击提交按钮生效",placement:"top"}},[a("el-button",{attrs:{type:"primary"}},[t._v("点击上传")])],1)],1)],1)],1)],1),t._v(" "),a("el-form",{ref:"final_acceptancs_form",staticClass:"demo-form-inline",attrs:{inline:!0,model:t.final_acceptancs_form,"label-width":"100px",rules:t.acceptanc_form_rules2,disabled:1==t.disabled_list[3]}},[a("el-row",[a("el-col",{attrs:{span:8}},[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"填写初验必须填写终验",placement:"top"}},[a("el-form-item",{attrs:{label:"是否终验",prop:"acceptanc_type"}},[a("el-select",{staticClass:"width-220",attrs:{clearable:""},model:{value:t.final_acceptancs_form.acceptanc_type,callback:function(e){t.$set(t.final_acceptancs_form,"acceptanc_type",e)},expression:"final_acceptancs_form.acceptanc_type"}},[a("el-option",{attrs:{label:"是",value:"2"}}),t._v(" "),a("el-option",{attrs:{label:"否",value:""}})],1)],1)],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"项目验收日期",prop:"acceptanc_date"}},[a("el-date-picker",{staticClass:"width-220",attrs:{type:"date","value-format":"yyyy-MM-dd"},model:{value:t.final_acceptancs_form.acceptanc_date,callback:function(e){t.$set(t.final_acceptancs_form,"acceptanc_date",e)},expression:"final_acceptancs_form.acceptanc_date"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"备注"}},[a("el-input",{staticClass:"width-220",attrs:{type:"textarea",rows:2,placeholder:"备注",clearable:""},model:{value:t.final_acceptancs_form.acceptanc_note,callback:function(e){t.$set(t.final_acceptancs_form,"acceptanc_note",e)},expression:"final_acceptancs_form.acceptanc_note"}})],1)],1)],1),t._v(" "),a("el-row",[a("el-form-item",{attrs:{lalel:"上传附件"}},[a("el-upload",{staticClass:"upload-demo",attrs:{action:t.upload_url,multiple:"","file-list":t.acceptancs_appendix_list,"http-request":t.acceptances_upload,"on-preview":t.download_file,"on-remove":t.on_remove}},[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"上传后点击提交按钮生效",placement:"top"}},[a("el-button",{attrs:{type:"primary"}},[t._v("点击上传")])],1)],1)],1)],1)],1)],1)])],1),t._v(" "),a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"},on:{click:function(e){t.rebacks_show=!t.rebacks_show}}},[t._v("合同回款信息(财务部)")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1!=t.disabled_list[1],expression:"disabled_list[1]!=1"}],staticStyle:{float:"right",padding:"8px 0",color:"#c9cabb"},attrs:{type:"text"},on:{click:function(e){t.form_submit("reback")}}},[t._v("提交")])],1),t._v(" "),a("transition",{attrs:{name:"el-fade-in-linear"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.rebacks_show,expression:"rebacks_show"}],attrs:{id:"rebacks_data_table"}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.rebacks_data}},[a("el-table-column",{attrs:{label:"回款进度",prop:"reback_progress","min-width":"100",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"actual_reback_amount",label:"实际回款金额","min-width":"200",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"回款比例(%)","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(t.reback_propority_cal(e.$index))+"\n            ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"reback_date",label:"回款日期","min-width":"200",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"reback_note",label:"回款备注","min-width":"300",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作",width:"140",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button-group",[a("el-button",{attrs:{type:"primary",size:"mini",round:"",disabled:1==t.disabled_list[1]},nativeOn:{click:function(a){a.preventDefault(),t.reback_data_modify(e.$index,t.rebacks_data)}}},[t._v("\n                  修改\n                ")]),t._v(" "),a("el-button",{attrs:{type:"danger",size:"mini",round:"",disabled:1==t.disabled_list[1]},nativeOn:{click:function(a){a.preventDefault(),t.data_delete(e.$index,t.rebacks_data,"rebacks")}}},[t._v("\n                  移除\n                ")])],1)]}}])})],1),t._v(" "),a("el-row",[a("el-button",{staticClass:"add_button",attrs:{type:"text",disabled:1==t.disabled_list[1]},on:{click:function(e){t.rebacks_dialog_show=!0}}},[t._v("添加合同回款信息")])],1)],1)])],1),t._v(" "),a("el-dialog",{attrs:{id:"rebacks_dialog",title:"回款信息",visible:t.rebacks_dialog_show,width:"30%","show-close":!1},on:{"update:visible":function(e){t.rebacks_dialog_show=e}}},[a("el-form",{ref:"rebacks_form",attrs:{model:t.rebacks_form,"label-width":"150px","label-position":"left",rules:t.rebacks_form_rules}},[a("el-form-item",{attrs:{label:"实际回款金额",prop:"actual_reback_amount"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入金额",clearable:""},model:{value:t.rebacks_form.actual_reback_amount,callback:function(e){t.$set(t.rebacks_form,"actual_reback_amount",e)},expression:"rebacks_form.actual_reback_amount"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"回款日期",prop:"reback_date"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date","value-format":"yyyy-MM-dd",clearable:""},model:{value:t.rebacks_form.reback_date,callback:function(e){t.$set(t.rebacks_form,"reback_date",e)},expression:"rebacks_form.reback_date"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"reback_note"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"备注",type:"textarea",rows:2},model:{value:t.rebacks_form.reback_note,callback:function(e){t.$set(t.rebacks_form,"reback_note",e)},expression:"rebacks_form.reback_note"}})],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.rebacks_dialog_cancel()}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.rebacks_dialog_confirm()}}},[t._v("确 定")])],1)],1),t._v(" "),a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"},on:{click:function(e){t.receipts_show=!t.receipts_show}}},[t._v("合同开票信息(财务部)")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1!=t.disabled_list[1],expression:"disabled_list[1]!=1"}],staticStyle:{float:"right",padding:"8px 0",color:"#c9cabb"},attrs:{type:"text"},on:{click:function(e){t.form_submit("receipt")}}},[t._v("提交")])],1),t._v(" "),a("transition",{attrs:{name:"el-fade-in-linear"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.receipts_show,expression:"receipts_show"}],attrs:{id:"receipts_data_table"}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.receipts_data}},[a("el-table-column",{attrs:{prop:"receipt_progress",label:"开票进度","min-width":"100",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"receipt_amount",label:"开票金额","min-width":"150",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"oa_flow_id",label:"OA流水号","min-width":"150",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"开票比例(%)","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(t.receipt_propority_cal(e.$index))+"\n            ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"累计开票金额","min-width":"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(t.total_receipt_amount_cal(e.$index))+"\n            ")]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"是否回款","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(t.is_reback_cal(e.$index))+"\n            ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"receipt_note",label:"备注","min-width":"300",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作",width:"140",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button-group",[a("el-button",{attrs:{type:"primary",size:"mini",round:"",disabled:1==t.disabled_list[1]},nativeOn:{click:function(a){a.preventDefault(),t.receipt_data_modify(e.$index,t.receipts_data)}}},[t._v("\n                  修改\n                ")]),t._v(" "),a("el-button",{attrs:{type:"danger",size:"mini",round:"",disabled:1==t.disabled_list[1]},nativeOn:{click:function(a){a.preventDefault(),t.data_delete(e.$index,t.receipts_data,"receipts")}}},[t._v("\n                  移除\n                ")])],1)]}}])})],1),t._v(" "),a("el-row",[a("el-button",{staticClass:"add_button",attrs:{type:"text",disabled:1==t.disabled_list[1]},on:{click:function(e){t.receipts_dialog_show=!0}}},[t._v("添加开票信息")])],1)],1)])],1),t._v(" "),a("el-dialog",{attrs:{id:"receipts_dialog",title:"开票合同",visible:t.receipts_dialog_show,width:"30%","show-close":!1},on:{"update:visible":function(e){t.receipts_dialog_show=e}}},[a("el-form",{ref:"receipts_form",attrs:{model:t.receipts_form,"label-width":"150px","label-position":"left",rules:t.receipts_form_rules}},[a("el-form-item",{attrs:{label:"开票金额",prop:"receipt_amount"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入金额"},model:{value:t.receipts_form.receipt_amount,callback:function(e){t.$set(t.receipts_form,"receipt_amount",e)},expression:"receipts_form.receipt_amount"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"OA流水号",prop:"oa_flow_id"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入流水号"},model:{value:t.receipts_form.oa_flow_id,callback:function(e){t.$set(t.receipts_form,"oa_flow_id",e)},expression:"receipts_form.oa_flow_id"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"receipt_note"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"备注",type:"textarea",rows:2},model:{value:t.receipts_form.receipt_note,callback:function(e){t.$set(t.receipts_form,"receipt_note",e)},expression:"receipts_form.receipt_note"}})],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.receipts_dialog_cancel()}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.receipts_dialog_confirm()}}},[t._v("确 定")])],1)],1),t._v(" "),a("el-card",{staticClass:"box-card",attrs:{id:"tail"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"},on:{click:function(e){t.delivers_show=!t.delivers_show}}},[t._v("发货信息(生产部)")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1!=t.disabled_list[2],expression:"disabled_list[2]!=1"}],staticStyle:{float:"right",padding:"8px 0",color:"#c9cabb"},attrs:{type:"text"},on:{click:function(e){t.form_submit("deliver")}}},[t._v("提交")])],1),t._v(" "),a("transition",{attrs:{name:"el-fade-in-linear"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.delivers_show,expression:"delivers_show"}],attrs:{id:"delivers_data_table"}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.delivers_data}},[a("el-table-column",{attrs:{prop:"deliver_goods_date",label:"发货日期",width:"300",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"goods_acceptanc_date",label:"到货验收日期",width:"300",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{"min-width":"10",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作",width:"140",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button-group",[a("el-button",{attrs:{disabled:1==t.disabled_list[2],type:"primary",size:"mini",round:""},nativeOn:{click:function(a){a.preventDefault(),t.deliver_data_modify(e.$index,t.delivers_data)}}},[t._v("\n                  修改\n                ")]),t._v(" "),a("el-button",{attrs:{disabled:1==t.disabled_list[2],type:"danger",size:"mini",round:""},nativeOn:{click:function(a){a.preventDefault(),t.data_delete(e.$index,t.delivers_data,"delivers")}}},[t._v("\n                  移除\n                ")])],1)]}}])})],1),t._v(" "),a("el-row",[a("el-button",{staticClass:"add_button",attrs:{type:"text",disabled:1==t.disabled_list[2]},on:{click:function(e){t.delivers_dialog_show=!0}}},[t._v("添加发货信息")])],1)],1)])],1),t._v(" "),a("el-dialog",{attrs:{id:"delivers_dialog",title:"发货信息",visible:t.delivers_dialog_show,width:"30%","show-close":!1},on:{"update:visible":function(e){t.delivers_dialog_show=e}}},[a("el-form",{ref:"delivers_form",attrs:{model:t.delivers_form,"label-width":"150px","label-position":"left",rules:t.add_rules}},[a("el-form-item",{attrs:{label:"发货日期",prop:"deliver_goods_date"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date","value-format":"yyyy-MM-dd"},model:{value:t.delivers_form.deliver_goods_date,callback:function(e){t.$set(t.delivers_form,"deliver_goods_date",e)},expression:"delivers_form.deliver_goods_date"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"到货验收日期",prop:"goods_acceptanc_date"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date","value-format":"yyyy-MM-dd"},model:{value:t.delivers_form.goods_acceptanc_date,callback:function(e){t.$set(t.delivers_form,"goods_acceptanc_date",e)},expression:"delivers_form.goods_acceptanc_date"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"上传文件"}},[a("el-upload",{staticClass:"upload-demo",attrs:{action:t.upload_url,multiple:"","file-list":t.delivers_form.delivers_appendix_list,"http-request":t.delivers_upload,"on-preview":t.download_file,"on-remove":t.on_remove}},[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"上传后点击提交按钮生效",placement:"top"}},[a("el-button",{attrs:{type:"primary"}},[t._v("点击上传")])],1)],1)],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.delivers_dialog_cancel()}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.delivers_dialog_confirm()}}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var C=a("VU/8")($,S,!1,function(t){a("2Gcp")},"data-v-83c90286",null).exports,F={name:"manage",data:function(){return{contract_unid_data:[],customer_name_data:[],salesperson_name_data:[],project_name_data:[],users_data:[],add_dialog_show:!1,login_user_dialog_show:!1,code_base_url:this.$disparch_data.code_base_url,contract_base_url:this.$disparch_data.contract_base_url,auth_base_url:this.$disparch_data.auth_base_url,contract_unid:null,customer_name:null,salesperson:null,project_name:null,selected_user_data:{user_unid:"",user_name:"",user_role_unid:""},selected_user_role_unid_before_modify:"",add_data:{text:null,data:[],url:null},roles:[],login_user_form:{role_unid:"",username:"",name:"",password:"0000",norm_type:"login"},login_user_form_rules:{username:{required:!0,pattern:/^[a-zA-Z]{2,8}$/,message:"请输入2至8位英文",trigger:"blur"},name:{required:!0,message:"请输入用户姓名",trigger:"blur"},role_unid:{required:!0,message:"请选择用户类型",trigger:"blur"}}}},methods:{search_contract_unid:function(t,e){var a=this.contract_unid_data;e(t?a.filter(this.contract_unid_filter(t)):a)},search_customer_name:function(t,e){var a=this.customer_name_data;e(t?a.filter(this.customer_name_filter(t)):a)},search_salesperson:function(t,e){var a=this.salesperson_name_data;e(t?a.filter(this.salesperson_filter(t)):a)},search_project_name:function(t,e){var a=this.project_name_data;e(t?a.filter(this.project_name_filter(t)):a)},contract_unid_filter:function(t){return function(e){return 0===e.toLowerCase().indexOf(t.toLowerCase())}},customer_name_filter:function(t){return function(e){return e.customer_name?0===e.customer_name.toLowerCase().indexOf(t.toLowerCase()):""}},salesperson_filter:function(t){return function(e){return e.name?0===e.name.toLowerCase().indexOf(t.toLowerCase()):""}},project_name_filter:function(t){return function(e){return e.project_name?0===e.project_name.toLowerCase().indexOf(t.toLowerCase()):""}},get_contract_unid:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"codes"}).then(function(e){t.contract_unid_data=e.data}).catch(function(t){console.log(t.message)})},get_salesperson:function(){var t=this;this.$Axios({method:"get",url:this.auth_base_url+"users",params:{norm_type:"employee"}}).then(function(e){t.salesperson_name_data=e.data.list_data}).catch(function(t){console.log(t.message)})},get_customers:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"customers",headers:{"Content-Type":"application/json"}}).then(function(e){t.customer_name_data=e.data}).catch(function(t){console.log(t.message)})},get_projects:function(){var t=this;this.$Axios({method:"get",url:this.contract_base_url+"projects",headers:{"Content-Type":"application/json"}}).then(function(e){t.project_name_data=e.data}).catch(function(t){console.log(t.message)})},product_line_type:function(){this.add_data.url=this.code_base_url+"custom/cates/4FC51AD3C9/codes",this.get_data(this.add_data.url)},contract_statu:function(){this.add_data.url=this.code_base_url+"custom/cates/13BEFACBCF/codes",this.get_data(this.add_data.url)},contract_type:function(){this.add_data.url=this.code_base_url+"custom/cates/8EC31D08A0/codes",this.get_data(this.add_data.url)},amount_statu:function(){this.add_data.url=this.code_base_url+"custom/cates/42407C5EF2/codes",this.get_data(this.add_data.url)},delete_code:function(t){var e=this;this.$confirm("确认删除数据?","确认信息",{confirmButtonText:"确认",cancelButtonText:"取消"}).then(function(){e.$Axios({method:"delete",url:e.add_data.url+"/"+t.unid}).then(function(t){e.show_message("删除成功","success"),e.get_data(e.add_data.url)})}).catch(function(){})},get_data:function(t){var e=this;this.$Axios.get(t).then(function(t){t.data.list_data&&(e.add_data.data=t.data.list_data,e.add_dialog_show=!0)})},add_to_database:function(){var t=this;if(null!=this.add_data.text){var e=0;this.add_data.data.forEach(function(t){t.code>e&&(e=t.code)}),e++,this.$Axios({method:"post",url:this.add_data.url,data:{name:this.add_data.text.trim(),note:this.add_data.text.trim(),code:e}}).then(function(a){a.data.code==e&&(t.show_message("添加成功","success"),t.add_data.text=null,t.get_data(t.add_data.url))})}else this.$message.error("不能为空")},get_users:function(){var t=this;this.$Axios({method:"get",url:this.auth_base_url+"users",params:{norm_type:"login"}}).then(function(e){t.$set(t,"users_data",e.data.list_data)}).catch(function(t){console.log(t.message)})},contract_unid_add:function(){var t=this;this.contract_unid?this.$Axios({method:"post",data:{contract_unid:this.contract_unid.trim()},url:this.contract_base_url,headers:{"Content-Type":"application/json"}}).then(function(e){"200"==e.data.ecode?(t.contract_unid=null,t.show_message("添加成功","success"),t.get_contract_unid()):"600"==e.data.ecode?t.show_message("重复的合同编号","error"):t.show_message("添加失败","error")}).catch(function(e){console.log(e),t.show_message("添加失败","error")}):this.show_message("请填写信息","info")},customer_name_add:function(){var t=this;this.customer_name?this.$Axios({method:"post",url:this.contract_base_url+"customers",data:{customer_name:this.customer_name.trim()},headers:{"Content-Type":"application/json"}}).then(function(e){"200"==e.data.ecode?(t.customer_name=null,t.show_message("添加成功","success"),t.get_customers()):"600"==e.data.ecode?t.show_message("重复的客户名称","error"):t.show_message("添加失败","error")}).catch(function(e){console.log(e),t.show_message("添加失败","error")}):this.show_message("请填写信息","info")},salesperson_add:function(t){var e=this;this.salesperson?this.$Axios({method:"post",url:this.auth_base_url+"users",data:{norm_type:t,username:this.salesperson.trim(),name:this.salesperson.trim(),password:"0000"},headers:{"Content-Type":"application/json"}}).then(function(t){t.data.name&&(e.salesperson=null,e.show_message("添加成功","success"),e.get_salesperson())}).catch(function(t){e.show_message("添加失败","error"),console.log(t.message)}):this.show_message("请填写信息","info")},project_name_add:function(){var t=this;this.project_name?this.$Axios({method:"post",url:this.contract_base_url+"projects",data:{project_name:this.project_name.trim()},headers:{"Content-Type":"application/json"}}).then(function(e){t.project_name=null,"200"==e.data.ecode?(t.show_message("添加成功","success"),t.get_projects()):"600"==e.data.ecode?t.show_message("重复的项目名称","error"):t.show_message("添加失败","error")}).catch(function(e){console.log(e),t.show_message("添加失败","error")}):this.show_message("请填写信息","info")},show_message:function(t,e){this.$message({message:t,type:e,center:!0,showClose:!0,duration:3e3})},get_roles:function(){var t=this;this.$Axios({method:"get",url:this.auth_base_url+"roles"}).then(function(e){e.data.list_data?t.roles=e.data.list_data:t.show_message("失败","error")}).catch(function(e){t.show_message("失败","error"),console.log(e.message)})},select_user_to_modify:function(t){t.roles&&(this.selected_user_data.user_name=t.name,this.selected_user_data.user_unid=t.user_unid,this.selected_user_data.user_role_unid=t.roles[0].role_unid,this.selected_user_role_unid_before_modify=t.roles[0].role_unid)},reset_role:function(){this.selected_user_data={user_unid:"",user_name:"",user_role_unid:""},this.selected_user_role_unid_before_modify=""},user_role_modify:function(){var t=this;if(this.selected_user_data.user_unid&&this.selected_user_data.user_role_unid&&this.selected_user_role_unid_before_modify){var e=this.selected_user_data.user_unid,a=this.selected_user_data.user_role_unid,s=this.selected_user_role_unid_before_modify;this.$Axios({method:"delete",url:this.auth_base_url+"/users/"+e+"/roles/"+s}).then(function(s){t.$Axios({method:"post",url:t.auth_base_url+"/users/"+e+"/roles",data:{role_unid:a}}).then(function(e){t.show_message("修改成功","success"),t.get_users()}).catch(function(t){})}).catch(function(t){}),this.reset_role()}else this.show_message("?????","warning")},login_user_dialog_cancel:function(){this.$refs.login_user_form.resetFields(),this.login_user_dialog_show=!1},login_user_dialog_confirm:function(){var t=this;this.$refs.login_user_form.validate(function(e){e&&t.$Axios({method:"post",url:t.auth_base_url+"users",headers:{"Content-Type":"application/json"},data:t.login_user_form}).then(function(e){e.data.user_unid?t.$Axios({method:"post",url:t.auth_base_url+"users/"+e.data.user_unid+"/roles",headers:{"Content-Type":"application/json"},data:{role_unid:t.login_user_form.role_unid}}).then(function(e){t.show_message("添加成功,默认密码: 0000","success"),t.$refs.login_user_form.resetFields(),t.login_user_dialog_show=!1}).catch(function(e){t.login_user_dialog_show=!1,t.show_message("添加失败","error")}):t.show_message("添加失败","error")}).catch(function(e){console.log(e),t.show_message("添加失败","error")})})},change_dialog:function(){if(localStorage.getItem("style"))for(var t=JSON.parse(localStorage.getItem("style")),e=document.getElementsByClassName("el-dialog"),a=0;a<e.length;a++){var s=e[a];s.style.backgroundColor=t.color,s.style.backgroundImage=t.image}}},created:function(){this.get_roles(),this.get_users(),this.get_contract_unid(),this.get_salesperson(),this.get_customers(),this.get_projects()},mounted:function(){this.change_dialog()}},j={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-card",{staticClass:"box-card",attrs:{id:"manage"}},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"}},[t._v("后台管理")])]),t._v(" "),a("el-row",{staticStyle:{"text-align":"left","border-bottom":"1px solid #ebeef5","padding-bottom":"18px"},attrs:{type:"flex",justify:"start"}},[a("el-col",{attrs:{span:6}},[a("el-autocomplete",{staticClass:"input",attrs:{"fetch-suggestions":t.search_contract_unid,placeholder:"合同编号"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.item;return[a("span",{staticClass:"name"},[t._v(t._s(s))])]}}]),model:{value:t.contract_unid,callback:function(e){t.contract_unid=e},expression:"contract_unid"}}),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.contract_unid_add}},[t._v("添加")])],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-autocomplete",{staticClass:"input",attrs:{"fetch-suggestions":t.search_customer_name,placeholder:"客户名称"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.item;return[a("span",{staticClass:"name"},[t._v(t._s(s.customer_name))])]}}]),model:{value:t.customer_name,callback:function(e){t.customer_name=e},expression:"customer_name"}}),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.customer_name_add}},[t._v("添加")])],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-autocomplete",{staticClass:"input",attrs:{"fetch-suggestions":t.search_salesperson,placeholder:"销售员"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.item;return[a("span",{staticClass:"name"},[t._v(t._s(s.username))])]}}]),model:{value:t.salesperson,callback:function(e){t.salesperson=e},expression:"salesperson"}}),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.salesperson_add("employee")}}},[t._v("添加")])],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-autocomplete",{staticClass:"input",attrs:{"fetch-suggestions":t.search_project_name,placeholder:"项目名称"},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.item;return[a("span",{staticClass:"name"},[t._v(t._s(s.project_name))])]}}]),model:{value:t.project_name,callback:function(e){t.project_name=e},expression:"project_name"}}),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.project_name_add}},[t._v("添加")])],1)],1),t._v(" "),a("el-row",{staticStyle:{"border-bottom":"1px solid rgb(235, 238, 245)","padding-bottom":"18px"}},[a("el-col",{attrs:{span:6}},[a("el-button",{staticClass:"add_button",attrs:{type:"primary"},on:{click:t.product_line_type}},[t._v("产品线类型")])],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{staticClass:"add_button",attrs:{type:"primary"},on:{click:t.contract_statu}},[t._v("合同状态")])],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{staticClass:"add_button",attrs:{type:"primary"},on:{click:t.contract_type}},[t._v("合同性质")])],1),t._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{staticClass:"add_button",attrs:{type:"primary"},on:{click:t.amount_statu}},[t._v("账款状态")])],1)],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:6}},[a("el-button",{staticClass:"add_button",attrs:{type:"primary"},on:{click:function(e){t.login_user_dialog_show=!t.login_user_dialog_show}}},[t._v("用户管理")])],1)],1),t._v(" "),a("el-dialog",{attrs:{visible:t.login_user_dialog_show,width:"30%","show-close":!1},on:{"update:visible":function(e){t.login_user_dialog_show=e}}},[a("el-tabs",{directives:[{name:"show",rawName:"v-show",value:t.login_user_dialog_show,expression:"login_user_dialog_show"}],staticStyle:{margin:"auto"},attrs:{type:"border-card"}},[a("el-tab-pane",{attrs:{label:"新建用户"}},[a("el-form",{ref:"login_user_form",attrs:{model:t.login_user_form,"label-width":"100px","label-position":"left",rules:t.login_user_form_rules}},[a("el-form-item",{attrs:{label:"用户类型",prop:"role_unid"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"用户类型"},model:{value:t.login_user_form.role_unid,callback:function(e){t.$set(t.login_user_form,"role_unid",e)},expression:"login_user_form.role_unid"}},t._l(t.roles,function(t){return a("el-option",{key:t.role_unid,attrs:{label:t.name,value:t.role_unid}})}))],1),t._v(" "),a("el-form-item",{attrs:{label:"用户名",prop:"username"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"用户名"},model:{value:t.login_user_form.username,callback:function(e){t.$set(t.login_user_form,"username",e)},expression:"login_user_form.username"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"姓名",prop:"name"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"姓名"},model:{value:t.login_user_form.name,callback:function(e){t.$set(t.login_user_form,"name",e)},expression:"login_user_form.name"}})],1)],1),t._v(" "),a("el-button-group",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.login_user_dialog_confirm()}}},[t._v("确 定")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.login_user_dialog_cancel()}}},[t._v("取 消")])],1)],1),t._v(" "),a("el-tab-pane",{attrs:{label:"权限管理"}},[a("el-form",{ref:"selected_user_data",attrs:{model:t.selected_user_data,"label-width":"60px","label-position":"left"}},[a("el-form-item",{attrs:{label:"姓名"}},[a("el-input",{attrs:{disabled:!0},model:{value:t.selected_user_data.user_name,callback:function(e){t.$set(t.selected_user_data,"user_name",e)},expression:"selected_user_data.user_name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"权限"}},[a("el-select",{staticStyle:{width:"100%"},model:{value:t.selected_user_data.user_role_unid,callback:function(e){t.$set(t.selected_user_data,"user_role_unid",e)},expression:"selected_user_data.user_role_unid"}},t._l(t.roles,function(t){return a("el-option",{key:t.role_unid,attrs:{label:t.name,value:t.role_unid}})}))],1),t._v(" "),a("el-button-group",[a("el-button",{attrs:{type:"primary"},on:{click:t.user_role_modify}},[t._v("确定")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.reset_role}},[t._v("重置")])],1)],1),t._v(" "),a("br"),t._v(" "),a("el-table",{staticStyle:{"max-height":"350px","overflow-y":"auto"},attrs:{data:t.users_data,border:""}},[a("el-table-column",{attrs:{label:"姓名",prop:"name","min-width":"20%",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"权限",prop:"roles[0].name","min-width":"20%",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"20%",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.select_user_to_modify(e.row)}}},[t._v("\n                修改\n              ")])]}}])})],1)],1)],1)],1),t._v(" "),a("el-dialog",{attrs:{"lock-scroll":"",visible:t.add_dialog_show,width:"30%","show-close":!1},on:{"update:visible":function(e){t.add_dialog_show=e}}},[a("el-input",{model:{value:t.add_data.text,callback:function(e){t.$set(t.add_data,"text",e)},expression:"add_data.text"}}),t._v(" "),a("el-button",{staticStyle:{width:"100%","margin-bottom":"20px","margin-top":"5px"},attrs:{type:"primary"},on:{click:t.add_to_database}},[t._v("添加")]),t._v(" "),a("el-table",{staticStyle:{"max-height":"350px","overflow-y":"auto","z-index":"inherit"},attrs:{data:t.add_data.data}},[a("el-table-column",{attrs:{label:"名称",prop:"name","min-width":"30%",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"码",prop:"code","min-width":"30%",align:"center"}})],1)],1)],1)},staticRenderFns:[]};var A=a("VU/8")(F,j,!1,function(t){a("IOLY")},"data-v-94d61f22",null).exports,I={render:function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:"logo-fade"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:this.show,expression:"show"}],staticStyle:{align:"center"}},[e("span",{staticStyle:{"font-size":"100px","margin-top":"15%","margin-bottom":"0","margin-left":"auto","margin-right":"auto","background-color":"black",color:"white",width:"622px",display:"block"}},[this._v("合同管理系统")]),this._v(" "),e("img",{attrs:{src:a("7Otq"),alt:""}})])])},staticRenderFns:[]};var E=a("VU/8")({data:function(){return{show:!1}},mounted:function(){this.show=!0}},I,!1,function(t){a("g3Vf")},"data-v-23717f89",null).exports,D={name:"user",data:function(){var t=this;return{color:"天空蓝",new_password_type:"password",odd_password_type:"password",new_password_view:"icon i-password-not-view",odd_password_view:"icon i-password-not-view",rtoken:"",user_unid:"",auth_base_url:this.$disparch_data.auth_base_url,password_form:{odd_password:"",new_password:"",check_password:""},password_form_rules:{odd_password:{required:!0,message:"请填写旧密码",trigger:"blur"},new_password:[{pattern:/^[A-Za-z0-9\x20-\x7f]{6,16}$/,message:"密码至少6位,至多16位",trigger:"blur"},{required:!0,message:"必须填写新密码",trigger:"blur"},{validator:function(e,a,s){a==t.password_form.odd_password?s(new Error("新密码不能和旧密码相同")):s()},trigger:"blur"}],check_password:[{pattern:/^[A-Za-z0-9\x20-\x7f]{6,16}$/,message:"密码至少6位,至多16位",trigger:"blur"},{required:!0,message:"必须填写新密码",trigger:"blur"},{validator:function(e,a,s){a!=t.password_form.new_password?s(new Error("两次输入不一致")):s()},trigger:"blur"}]}}},methods:{change_color:function(){var t="none",e="none";switch(this.color){case"天空蓝":t="lightblue";break;case"梦幻紫":t="#8ec5fc",e="linear-gradient(225deg, #8ec5fc 0%, #e0c3fc 100%)";break;case"活力橙":t="#FBAB7E",e="linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)";break;case"柠檬绿":t="#F4D03F",e="linear-gradient(71deg, #F4D03F 0%, #16a046 92%)";break;case"灰灰灰":t="#f0f0f0";break;case"小清新":t="#FFDEE9",e="linear-gradient(0deg, #FFDEE9 0%, #B5FFFC 100%)"}var a=document.getElementsByClassName("el-main")[0];a.style["background-color"]=t,a.style.backgroundImage=e,localStorage.setItem("color",this.color),this.$router.go(0)},show_odd_password:function(){"password"==this.odd_password_type?(this.odd_password_type="text",this.odd_password_view="icon i-password-view"):(this.odd_password_type="password",this.odd_password_view="icon i-password-not-view")},show_new_password:function(){"password"==this.new_password_type?(this.new_password_type="text",this.new_password_view="icon i-password-view"):(this.new_password_type="password",this.new_password_view="icon i-password-not-view")},submitForm:function(t){var e=this;this.$refs[t].validate(function(t){t&&e.$Axios({method:"post",url:e.auth_base_url+"users/"+e.user_unid+"/password",headers:{authorization:e.rtoken},data:{old_pwd:e.password_form.odd_password,new_pwd:e.password_form.new_password}}).then(function(t){t.data.user_unid&&(e.$message({type:"success",message:"修改成功"}),e.resetForm("password_form"))}).catch(function(t){e.$message.error("修改失败"),e.resetForm("password_form")})})},resetForm:function(t){this.$refs[t].resetFields()}},created:function(){sessionStorage.getItem("user_unid")?(this.rtoken=sessionStorage.getItem("rtoken"),this.user_unid=sessionStorage.getItem("user_unid")):this.$router.push("/"),localStorage.getItem("color")&&(this.color=localStorage.getItem("color"))}},N={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"user_wrapper"}},[a("el-card",{staticClass:"box-card",staticStyle:{width:"30%"},attrs:{id:"user",shadow:"hover"}},[a("div",{staticClass:"clearfix",staticStyle:{"text-align":"center"},attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"}},[t._v("修改密码")])]),t._v(" "),a("el-form",{ref:"password_form",attrs:{model:t.password_form,rules:t.password_form_rules,"label-width":"60px","label-position":"top"}},[a("el-form-item",{attrs:{prop:"odd_password"}},[a("el-input",{attrs:{type:t.odd_password_type,"auto-complete":"off"},model:{value:t.password_form.odd_password,callback:function(e){t.$set(t.password_form,"odd_password",e)},expression:"password_form.odd_password"}},[a("template",{slot:"prepend"},[t._v("原密码")]),t._v(" "),a("el-button",{staticClass:"append_button",attrs:{slot:"append",icon:t.odd_password_view},on:{click:t.show_odd_password},slot:"append"})],2)],1),t._v(" "),a("el-form-item",{attrs:{prop:"new_password"}},[a("el-input",{attrs:{type:t.new_password_type,"auto-complete":"off"},model:{value:t.password_form.new_password,callback:function(e){t.$set(t.password_form,"new_password",e)},expression:"password_form.new_password"}},[a("template",{slot:"prepend"},[t._v("新密码")]),t._v(" "),a("el-button",{staticClass:"append_button",attrs:{slot:"append",icon:t.new_password_view},on:{click:t.show_new_password},slot:"append"})],2)],1),t._v(" "),a("el-form-item",{attrs:{prop:"check_password"}},[a("el-input",{attrs:{type:t.new_password_type,"auto-complete":"off"},model:{value:t.password_form.check_password,callback:function(e){t.$set(t.password_form,"check_password",e)},expression:"password_form.check_password"}},[a("template",{slot:"prepend"},[t._v("新密码")]),t._v(" "),a("el-button",{staticClass:"append_button",attrs:{slot:"append",icon:t.new_password_view},on:{click:t.show_new_password},slot:"append"})],2)],1),t._v(" "),a("el-form-item",[a("el-button-group",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitForm("password_form")}}},[t._v("提交")]),t._v(" "),a("el-button",{attrs:{type:"warning"},on:{click:function(e){t.resetForm("password_form")}}},[t._v("重置")])],1)],1)],1)],1),t._v(" "),a("el-card",{staticClass:"box-card",staticStyle:{width:"30%"},attrs:{id:"user",shadow:"hover"}},[a("div",{staticClass:"clearfix",staticStyle:{"text-align":"center"},attrs:{slot:"header"},slot:"header"},[a("span",{staticStyle:{"font-size":"24px",color:"#eff0dc"}},[t._v("主题颜色")])]),t._v(" "),a("el-radio-group",{on:{change:t.change_color},model:{value:t.color,callback:function(e){t.color=e},expression:"color"}},[a("el-row",{staticStyle:{"padding-bottom":"1px"}},[a("el-radio-button",{attrs:{label:"天空蓝"}}),t._v(" "),a("el-radio-button",{attrs:{label:"梦幻紫"}}),t._v(" "),a("el-radio-button",{attrs:{label:"活力橙"}})],1),t._v(" "),a("el-row",[a("el-radio-button",{attrs:{label:"柠檬绿"}}),t._v(" "),a("el-radio-button",{attrs:{label:"灰灰灰"}}),t._v(" "),a("el-radio-button",{attrs:{label:"小清新"}})],1)],1)],1)],1)},staticRenderFns:[]};var T=a("VU/8")(D,N,!1,function(t){a("yosT")},"data-v-c7df1b8c",null).exports;n.default.use(c.a);var O=new c.a({routes:[{path:"/",component:h},{path:"/nav",component:u,name:"nav",children:[{path:"search",component:x,name:"search"},{path:"contract/:contract_unid",component:C,name:"contract"},{path:"manage",component:A,name:"manage"},{path:"main",component:E,name:"main"},{path:"user",component:T,name:"user"}]}]}),B=a("zL8q"),q=a.n(B),z=a("mtWM"),M=a.n(z),J=a("Zcwg"),L=a.n(J);a("tvR6"),a("/Cky"),a("j1ja");n.default.component(L.a.name,L.a),n.default.config.productionTip=!1,n.default.prototype.$Axios=M.a,n.default.use(q.a),n.default.filter("twoDecimal",function(t){return(t=Number(t)).toFixed(2)});var R=void 0;var U=0;function V(){0===U&&(R=n.default.prototype.$loading({lock:!0,text:"加载中,请稍等",background:"rgba(0, 0, 0, 1)"})),U++}function H(){U<=0||0===--U&&R.close()}if(M.a.interceptors.request.use(function(t){return V(),t},function(t){return o.a.reject(t)}),M.a.interceptors.response.use(function(t){return setTimeout(function(){H()},300),t},function(t){return H(),o.a.reject(t)}),"localhost:8888"==window.location.host)n.default.prototype.$disparch_data={code_base_url:"http://192.168.9.162:20080/api/v1/codes/",contract_base_url:"http://192.168.9.162:20080/api/v1/financial/contracts/",auth_base_url:"http://192.168.9.162:20080/api/v1/auth/"};else{var Y=window.location.host;n.default.prototype.$disparch_data={code_base_url:"http://"+Y+"/api/v1/codes/",contract_base_url:"http://"+Y+"/api/v1/financial/contracts/",auth_base_url:"http://"+Y+"/api/v1/auth/"}}new n.default({el:"#app",router:O,components:{App:i},template:"<App/>"})},PL5t:function(t,e){},dGCZ:function(t,e){},eCAb:function(t,e){},"fi+V":function(t,e){},g3Vf:function(t,e){},tvR6:function(t,e){},yosT:function(t,e){}},[0]);
//# sourceMappingURL=app.8931ccf8fede6867ef49.js.map