2700.f9a7349c.js 4.4 KB

1
  1. "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[2700],{52700:function(t,e,i){i.r(e),i.d(e,{default:function(){return m}});var o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("el-button",{attrs:{size:"mini",type:"text",disabled:!t.tool.checkAuth(t.$route.name,"otherExpenses")||"新建"!==t.status},on:{click:t.onShow}},[t._v("编 辑")]),i("el-drawer",{attrs:{title:"修改其他费用",visible:t.visible,size:"800px",direction:"rtl","append-to-body":"","show-close":!1},on:{"update:visible":function(e){t.visible=e},close:t.onClose}},[i("div",{staticClass:"drawer__panel"},[i("el-row",[i("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,size:"mini","label-position":"right"}},[i("el-col",{attrs:{span:24}},[i("el-form-item",{attrs:{label:"类型","label-width":"80px",prop:"itemtype"}},[i("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:t.form.itemtype,callback:function(e){t.$set(t.form,"itemtype",e)},expression:"form.itemtype"}},t._l(t.itemtypes,(function(t){return i("el-option",{key:t.value,attrs:{label:t.value,value:t.value}})})),1)],1)],1),i("el-col",{attrs:{span:24}},[i("el-form-item",{attrs:{label:"费用明细","label-width":"80px",prop:"itemname"}},[i("el-input",{attrs:{type:"textarea",autocomplete:"off",placeholder:"输入费用明细",autosize:""},model:{value:t.form.itemname,callback:function(e){t.$set(t.form,"itemname",e)},expression:"form.itemname"}})],1)],1),i("el-col",{attrs:{span:24}},[i("el-form-item",{attrs:{label:"单价","label-width":"80px",prop:"price"}},[i("el-input",{attrs:{type:"number",autocomplete:"off",placeholder:"请输入单价"},on:{change:t.priceChange},model:{value:t.form.price,callback:function(e){t.$set(t.form,"price",e)},expression:"form.price"}})],1)],1),i("el-col",{attrs:{span:24}},[i("el-form-item",{attrs:{label:"数量","label-width":"80px",prop:"qty"}},[i("el-input",{attrs:{autocomplete:"off",placeholder:"请输入数量"},on:{change:t.numChange},model:{value:t.form.qty,callback:function(e){t.$set(t.form,"qty",e)},expression:"form.qty"}})],1)],1),i("el-col",{attrs:{span:24}},[i("el-form-item",{attrs:{label:"单位","label-width":"80px",prop:"unitname"}},[i("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:t.form.unitname,callback:function(e){t.$set(t.form,"unitname",e)},expression:"form.unitname"}},t._l(t.unitList,(function(t){return i("el-option",{key:t.unitname,attrs:{label:t.unitname,value:t.unitname}})})),1)],1)],1),i("el-col",{attrs:{span:24}},[i("el-form-item",{attrs:{label:"金额","label-width":"80px",prop:"amount"}},[i("el-input",{attrs:{autocomplete:"off",disabled:""},model:{value:t.form.amount,callback:function(e){t.$set(t.form,"amount",e)},expression:"form.amount"}})],1)],1)],1)],1)],1),i("div",{staticClass:"fixed__btn__panel"},[i("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:t.onClose}},[t._v("取 消")]),i("el-button",{staticClass:"normal-btn-width",attrs:{size:"small",disabled:""===t.form.itemtype&&""===t.form.itemname&&""===t.form.unitname&&""===t.form.qty&&""===t.form.price,type:"primary"},on:{click:t.onSubmit}},[t._v("确 定")])],1)])],1)},s=[],a={name:"edit",props:["data","status"],data(){return{visible:!1,amount:0,form:{},rules:{},unitList:[],itemtypes:[]}},methods:{onShow(){this.visible=!0,this.form=Object.assign({},this.form,this.data)},async onSubmit(){const t=await this.$api.requested({id:20230211155503,content:{sa_quotedpriceid:this.$route.query.id,items:[this.form]}});this.tool.showMessage(t,(()=>{this.$refs.form.resetFields(),this.visible=!1,this.$emit("editSuccess")}))},onClose(){this.$refs.form.resetFields(),this.visible=!1},async queryUnit(){const t=await this.$api.requested({id:"20220922084803",content:{where:{condition:""}}});this.unitList=t.data},queryType(){this.$store.dispatch("optiontypeselect","quotedpriceitemtype").then((t=>{this.itemtypes=t.data}))},numChange(){""!==this.form.qty&&""!==this.form.price?this.form.amount=Math.round(this.form.qty*this.form.price*100)/100:this.form.amount=0},priceChange(){""!==this.form.qty&&""!==this.form.price?(this.form.price=Math.round(100*this.form.price)/100,this.form.amount=Math.round(this.form.qty*this.form.price*100)/100):(this.form.price=Math.round(100*this.form.price)/100,this.form.amount=0)}},mounted(){this.queryUnit(),this.queryType()}},r=a,l=i(43736),n=(0,l.Z)(r,o,s,!1,null,"692f2dae",null),m=n.exports}}]);