| 1 |
- "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[7271],{17271:function(e,t,a){a.r(t),a.d(t,{default:function(){return d}});var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-button",{attrs:{size:"mini",type:e.btnType?e.btnType:"text"},on:{click:e.editBtn}},[e._v("编 辑")]),a("el-dialog",{attrs:{title:"新 建",visible:e.dialogFormVisible,width:"50%"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("div",{staticStyle:{"font-size":"15px"},attrs:{slot:"title"},slot:"title"},[e._v(" 编辑报价单 ")]),a("el-row",{attrs:{gutter:20}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px","label-position":"right",size:"mini"}},[a("el-col",{attrs:{span:12}},[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:12}},[a("el-form-item",{attrs:{label:"折扣率",prop:"discountrate"}},[a("el-input",{attrs:{placeholder:"请输入折扣率"},model:{value:e.form.discountrate,callback:function(t){e.$set(e.form,"discountrate",t)},expression:"form.discountrate"}})],1)],1),a("el-col",{attrs:{span:12}},[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:12}},[a("el-form-item",{attrs:{label:"有效日期",prop:"invaliddate"}},[a("el-date-picker",{attrs:{type:"date",placeholder:"选择日期"},on:{change:e.timeChange},model:{value:e.form.invaliddate,callback:function(t){e.$set(e.form,"invaliddate",t)},expression:"form.invaliddate"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入备注"},model:{value:e.form.remarks,callback:function(t){e.$set(e.form,"remarks",t)},expression:"form.remarks"}})],1)],1)],1)],1),a("div",{staticClass:"dialog-footer"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("取 消")]),a("el-button",{staticClass:"normal-btn-width btn-warning",attrs:{size:"small",type:"warning"},on:{click:e.onSubmit}},[e._v("确 定")])],1)],1)],1)},i=[],s={name:"add",inject:["detailData"],props:["data","btnType"],components:{},data(){return{dialogFormVisible:!1,form:{sa_quotedpriceid:0,sys_enterpriseid:"",sa_projectid:"",discountrate:"",remarks:"",invaliddate:"",projectname:"",address:""},rules:{projectname:[{required:!0,message:"输入项目名称",trigger:"blur"}],invaliddate:[{required:!0,message:"请选择报价有效期",trigger:"blur"}],discountrate:[{required:!0,message:"整单折扣率,保留2位小数",trigger:"blur"}]}}},methods:{editBtn(){console.log(this.data),this.dialogFormVisible=!0,this.form=Object.assign({},this.form,this.data)},onSubmit(){this.$refs["form"].validate((async e=>{if(!e)return!1;this.form.sys_enterpriseid=this.detailData().sys_enterpriseid,this.form.sa_projectid=parseInt(this.$route.query.id);const t=await this.$api.requested({id:"20221020164803",version:1,content:this.form});this.tool.showMessage(t,(()=>{this.$emit("onSuccess"),this.$refs["form"].resetFields(),this.dialogFormVisible=!1}))}))},timeChange(e){e||(this.form.invaliddate="");let t=this.changeTimeFormat(e.getTime());this.form.invaliddate=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}}},o=s,l=a(43736),n=(0,l.Z)(o,r,i,!1,null,"449ef968",null),d=n.exports}}]);
|