4495.f0c9f89c.js 14 KB

1
  1. "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[4495],{64495:function(e,t,a){a.r(t),a.d(t,{default:function(){return c}});var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(t){e.dialogFormVisible=!0}}},[e._v("新 建")]),a("el-drawer",{attrs:{title:"新建项目商机",visible:e.dialogFormVisible,size:"700px",direction:"rtl","append-to-body":"","show-close":!1},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.onClose}},[a("div",{staticClass:"drawer__panel"},[a("el-row",{attrs:{gutter:20}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"125px","label-position":"right",size:"mini"}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"项目名称:",prop:"projectname"}},[a("el-input",{attrs:{placeholder:"请输入项目名称"},model:{value:e.form.projectname,callback:function(t){e.$set(e.form,"projectname",t)},expression:"form.projectname"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"项目类型:",prop:"projecttype"}},[a("el-select",{attrs:{placeholder:"请选择项目类型",size:"mini"},model:{value:e.form.projecttype,callback:function(t){e.$set(e.form,"projecttype",t)},expression:"form.projecttype"}},e._l(e.projectType(),(function(t,r){return a("el-option",{key:r,attrs:{label:t.value,value:t.value}},[a("span",{staticStyle:{float:"left"}},[e._v(e._s(t.value))]),a("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"12px"}},[e._v(e._s(t.remarks?t.remarks:"暂无描述"))])])})),1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"项目等级:",prop:"grade"}},[a("el-select",{attrs:{placeholder:"请选择项目等级",size:"mini"},model:{value:e.form.grade,callback:function(t){e.$set(e.form,"grade",t)},expression:"form.grade"}},e._l(e.projectLead(),(function(t){return a("el-option",{key:t.value,attrs:{label:t.value,value:t.value}},[a("span",{staticStyle:{float:"left"}},[e._v(e._s(t.value))]),a("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"12px"}},[e._v(e._s(t.remarks?t.remarks:"暂无描述"))])])})),1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"省市县:",prop:"value"}},[a("el-cascader",{staticStyle:{width:"100%"},attrs:{options:e.basicData.data().areaData,clearable:""},on:{change:e.cascaderChange},model:{value:e.form.value,callback:function(t){e.$set(e.form,"value",t)},expression:"form.value"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"详细地址:",prop:"address"}},[a("el-input",{attrs:{placeholder:"请输入详细地址"},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"项目规模:",prop:"scale"}},[a("el-input",{attrs:{placeholder:"请输入建筑面积(㎡)/吨位(t)"},model:{value:e.form.scale,callback:function(t){e.$set(e.form,"scale",t)},expression:"form.scale"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"项目预算(元):",prop:"budgetary"}},[a("el-input",{attrs:{type:"number",placeholder:"项目预算"},model:{value:e.form.budgetary,callback:function(t){e.$set(e.form,"budgetary",t)},expression:"form.budgetary"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"总投资额(百万):",prop:"budgetary"}},[a("el-input",{attrs:{type:"number",placeholder:"总投资额"},model:{value:e.form.totalinvestment,callback:function(t){e.$set(e.form,"totalinvestment",t)},expression:"form.totalinvestment"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"造价(百万):",prop:"budgetary"}},[a("el-input",{attrs:{type:"number",placeholder:"造价"},model:{value:e.form.costofconstruction,callback:function(t){e.$set(e.form,"costofconstruction",t)},expression:"form.costofconstruction"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"预计开工时间:",prop:"begdate_due"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"month",placeholder:"选择月","picker-options":e.pickerOptions},model:{value:e.form.begdate_due,callback:function(t){e.$set(e.form,"begdate_due",t)},expression:"form.begdate_due"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"预计完工时间:",prop:"enddate_due"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"month",placeholder:"选择月","picker-options":e.pickerOptions},model:{value:e.form.enddate_due,callback:function(t){e.$set(e.form,"enddate_due",t)},expression:"form.enddate_due"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"预计签约时间:",prop:"signdate_due"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"month",placeholder:"选择月","picker-options":e.pickerOptions},model:{value:e.form.signdate_due,callback:function(t){e.$set(e.form,"signdate_due",t)},expression:"form.signdate_due"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"预计签约金额(元):",prop:"signamount_due"}},[a("el-input",{attrs:{placeholder:"请输入预计签约金额",disabled:""},model:{value:e.form.signamount_due,callback:function(t){e.$set(e.form,"signamount_due",t)},expression:"form.signamount_due"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"领域:",prop:"tradefield"}},[a("el-select",{attrs:{placeholder:"请选择领域"},model:{value:e.form.tradefield,callback:function(t){e.$set(e.form,"tradefield",t)},expression:"form.tradefield"}},e._l(e.tradefieldSelect,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"品牌:",prop:"sa_brandid"}},[a("el-select",{attrs:{placeholder:"请选择品牌"},model:{value:e.form.sa_brandid,callback:function(t){e.$set(e.form,"sa_brandid",t)},expression:"form.sa_brandid"}},e._l(e.brandSelect,(function(e){return a("el-option",{key:e.sa_brandid,attrs:{label:e.brandname,value:e.sa_brandid}})})),1)],1)],1)],1)],1)],1),a("div",{staticClass:"fixed__btn__panel"},[a("el-button",{staticClass:"normal-btn-width inline-16",attrs:{size:"small"},on:{click:e.onClose}},[e._v("取 消")]),a("duplicateCheck",{attrs:{data:e.form},on:{checkSuccess:e.checkSuccess}}),a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small",type:"primary"},on:{click:e.onSave}},[e._v("确 定")])],1)])],1)},s=[],o=(a(21703),a(1573)),l={name:"add",inject:["enterpriseList","projectType","projectLead","projectPanl"],components:{duplicateCheck:o.Z},data(){var e=(e,t,a)=>{console.log(t,this.form.enddate_due),""!==this.form.enddate_due&&t>this.form.enddate_due?a(new Error("预计开工时间不能晚于预计完工时间")):a()},t=(e,t,a)=>{""!==this.form.begdate_due&&t<this.form.begdate_due?a(new Error("预计完工时间不能早于预计开工时间")):a()};return{pickerOptions:{disabledDate(e){return e.getTime()<Date.now()}},dialogFormVisible:!1,checkResults:"",projectAddress:[],form:{sa_projectid:0,projectname:"",projectnum:"",address:"",grade:"",budgetary:"",remarks:"",projecttype:"",sa_projstagetempid:"",signdate_due:"",scale:"",signamount_due:"",province:"",city:"",county:"",totalinvestment:"",costofconstruction:"",begdate_due:"",enddate_due:"",sa_brandid:"",tradefield:"",value:[]},brandSelect:[],tradefieldSelect:[],value:[],rules:{projectname:[{required:!0,message:"输入项目名称",trigger:"blur"}],projecttype:[{required:!0,message:"请选择项目类型",trigger:"change"}],sys_enterpriseid:[{required:!0,message:"请选择企业",trigger:"blur"}],value:[{required:!0,message:"请选择省市县",trigger:"change"}],tradefield:[{required:!0,message:"请选择领域",trigger:"change"}],sa_brandid:[{required:!1,message:"请选择品牌",trigger:"change"}],begdate_due:[{required:!1,validator:e,trigger:"change"}],enddate_due:[{required:!1,validator:t,trigger:"change"}]}}},methods:{cascaderChange(e){if(1===e.length)return this.form=Object.assign({},this.form,{province:e[0],city:"",county:""});this.form=Object.assign({},this.form,{province:e[0],city:e[1],county:e[2]})},duplicateCheck(){this.$refs.form.validate((async e=>{if(!e)return!1;const t=await this.$api.requested({id:20221208184202,content:{projectname:this.form.projectname,address:this.form.address,sa_projectid:0}});console.log(t,"查重结果"),0!==t.data.length&&console.log("重复"),this.checkResults=t.data.length,this.onSave()}))},onSave(){""===this.checkResults?this.duplicateCheck():0!==this.checkResults?this.$confirm("该项目疑似重复,是否确认创建项目?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.onSubmit()})).catch((()=>{this.$message({type:"info",message:"已取消创建"})})):this.onSubmit()},onSubmit(){if(console.log(this.form),""!==this.form.signdate_due){const e=new Date(this.form.signdate_due);console.log(e.getFullYear()),console.log(e.getMonth()+1),e.getMonth()+1<10?this.form.signdate_due=e.getFullYear()+"-0"+(e.getMonth()+1):this.form.signdate_due=e.getFullYear()+"-"+(e.getMonth()+1)}else this.form.signdate_due="";if(""!==this.form.begdate_due){const e=new Date(this.form.begdate_due);console.log(e.getFullYear()),console.log(e.getMonth()+1),e.getMonth()+1<10?this.form.begdate_due=e.getFullYear()+"-0"+(e.getMonth()+1):this.form.begdate_due=e.getFullYear()+"-"+(e.getMonth()+1)}else this.form.begdate_due="";if(""!==this.form.enddate_due){const e=new Date(this.form.enddate_due);console.log(e.getFullYear()),console.log(e.getMonth()+1),e.getMonth()+1<10?this.form.enddate_due=e.getFullYear()+"-0"+(e.getMonth()+1):this.form.enddate_due=e.getFullYear()+"-"+(e.getMonth()+1)}else this.form.enddate_due="";console.log(this.form),this.$refs["form"].validate((async e=>{if(!e)return!1;const t=await this.$api.requested({id:"20221020144202",version:1,content:this.form});this.tool.showMessage(t,(()=>{0===this.checkResults?(this.$emit("onSuccess"),this.$refs["form"].resetFields(),this.value="",this.form={sa_projectid:0,projectname:"",projectnum:"",address:"",grade:"",budgetary:"",remarks:"",projecttype:"",sa_projstagetempid:"",signdate_due:"",scale:"",signamount_due:"",province:"",city:"",county:"",sa_brandid:"",tradefields:[]},this.dialogFormVisible=!1,this.checkResults=""):this.setTag(t.data.sa_projectid)}))}))},async setTag(e){await this.$api.requested({id:20220929090901,content:{ownertable:"sa_project",ownerid:e,datatag:["疑似重复"]}});this.$emit("onSuccess"),this.$refs["form"].resetFields(),this.form={sa_projectid:0,projectname:"",projectnum:"",address:"",grade:"",budgetary:"",remarks:"",projecttype:"",sa_projstagetempid:"",signdate_due:"",scale:"",signamount_due:"",province:"",city:"",county:"",sa_brandid:"",tradefields:[]},this.dialogFormVisible=!1,this.checkResults=""},timeChange(e){e||(this.form.signdate_due="");let t=this.changeTimeFormat(e.getTime());this.form.signdate_due=t},changeTimeFormat(e){var t=new Date(e),a=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,r=t.getDate()<10?"0"+t.getDate():t.getDate();return t.getFullYear()+"-"+a+"-"+r},onClose(){this.$refs["form"].resetFields(),this.dialogFormVisible=!1},async queryBrand(){const e=await this.$api.requested({content:{isExport:0,pageNumber:1,pageSize:20,where:{condition:"",tablefilter:{}}},id:20220922085103});this.brandSelect=e.data},queryTradefield(){this.$store.dispatch("optiontypeselect","tradefield").then((e=>{this.tradefieldSelect=e.data}))},checkSuccess(e){this.checkResults=e}},mounted(){this.queryBrand(),this.queryTradefield()}},i=l,n=a(43736),d=(0,n.Z)(i,r,s,!1,null,"6d3792fe",null),c=d.exports},1573:function(e,t,a){a.d(t,{Z:function(){return d}});var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-button",{staticClass:"inline-16 normal-btn-width",attrs:{size:"small",type:"primary"},on:{click:e.listData}},[e._v("查 重")]),a("el-dialog",{attrs:{title:"重复的项目",visible:e.dialogTableVisible,"append-to-body":""},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[a("el-table",{attrs:{data:e.duplicateData,"header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini"}},[a("el-table-column",{attrs:{property:"projectname",label:"项目名称",width:"150"}}),a("el-table-column",{attrs:{property:"address",label:"项目地址"}}),a("el-table-column",{attrs:{property:"name",label:"业务员",width:"150"}})],1),a("div",{staticClass:"container normal-panel",staticStyle:{"text-align":"right"}},[a("el-pagination",{attrs:{background:"","current-page":e.currentPage,"page-sizes":[10,20],layout:"total,sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"normal-btn-width ",attrs:{type:"primary",size:"mini"},on:{click:function(t){e.dialogTableVisible=!1}}},[e._v("确 定")])],1)],1)],1)},s=[],o={name:"duplicateCheck",props:["data"],data(){return{dialogTableVisible:!1,duplicateData:[],total:0,currentPage:0,param:{id:20221208184202,content:{projectname:"",address:"",sa_projectid:this.data.sa_projectid}}}},methods:{async listData(){this.param.content.projectname=this.data.projectname,this.param.content.address=this.data.address,this.param.content.sa_projectid=this.data.sa_projectid||0;const e=await this.$api.requested(this.param);console.log(e,"查重结果"),e.data.length>0?(this.dialogTableVisible=!0,this.duplicateData=e.data,this.total=e.total,this.currentPage=e.pageNumber):this.$message({message:"无重复数据",type:"success"}),this.$emit("checkSuccess",e.data.length)},handleSizeChange(e){this.param.content.pageSize=e,this.listData()},handleCurrentChange(e){this.param.content.pageNumber=e,this.listData()}}},l=o,i=a(43736),n=(0,i.Z)(l,r,s,!1,null,"7b0e398f",null),d=n.exports}}]);