chunk-17ae1b0a.59fee3f7.js 7.5 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-17ae1b0a"],{"0857":function(t,e,a){},ba7b:function(t,e,a){"use strict";a("0857")},ec5e:function(t,e,a){"use strict";a.r(e);var l=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.addTemplateDialogVisible?a("el-dialog",{attrs:{title:"新建",visible:t.addTemplateDialogVisible,width:"1200px","close-on-press-escape":!1,"close-on-click-modal":!1},on:{"update:visible":function(e){t.addTemplateDialogVisible=e},close:t.cancel}},[a("div",{staticStyle:{height:"65vh",overflow:"auto"}},[a("el-row",{staticStyle:{margin:"0",height:"100%"},attrs:{gutter:20}},[a("el-col",{attrs:{span:4,xs:24}},[a("div",{staticClass:"head-container",staticStyle:{"max-height":"calc(100vh - 160px)","overflow-y":"auto"}},[a("el-tree",{ref:"tree",attrs:{data:t.deptOptions,props:t.defaultProps,"check-on-click-node":!0,"expand-on-click-node":!1,"show-checkbox":"","node-key":"id","default-expand-all":"","highlight-current":"","check-strictly":!0},on:{check:t.handleNodeClick},scopedSlots:t._u([{key:"default",fn:function(e){var l=e.node;e.data;return a("span",{staticClass:"custom-tree-node"},[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:l.label,placement:"top-start","open-delay":500}},[a("span",[t._v(" "+t._s(l.label)+" ")])])],1)}}],null,!1,1416256344)})],1)]),a("el-col",{staticStyle:{height:"100%"},attrs:{span:20,xs:24}},[a("el-table",{staticStyle:{width:"100%",height:"45%",overflow:"auto","margin-bottom":"10px"},attrs:{height:"calc(45% - 45px)",data:t.tableData}},[a("el-table-column",{attrs:{label:"项目编号","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.projectCode||"-"))])]}}],null,!1,2786882419)}),a("el-table-column",{attrs:{label:"项目名称","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.projectName||"-"))])]}}],null,!1,3307174009)}),a("el-table-column",{attrs:{label:"单价","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.unitPrice||"-"))])]}}],null,!1,138632224)}),a("el-table-column",{attrs:{label:"单位","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.unit||"-"))])]}}],null,!1,2417366221)}),a("el-table-column",{attrs:{label:"操作",align:"center",width:"120",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("i",{staticClass:"el-icon-circle-plus-outline",staticStyle:{cursor:"pointer"},on:{click:function(a){return t.doAdd(e.row)}}})]}}],null,!1,3988627251)})],1),a("h3",[t._v("已选择的项目")]),a("el-table",{staticStyle:{width:"100%",height:"45%",overflow:"auto"},attrs:{height:"calc(45% - 45px)",data:t.tableDataDown}},[a("el-table-column",{attrs:{label:"项目编号","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.projectCode||"-"))])]}}],null,!1,2786882419)}),a("el-table-column",{attrs:{label:"项目名称","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.projectName||"-"))])]}}],null,!1,3307174009)}),a("el-table-column",{attrs:{label:"单价","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.unitPrice||"-"))])]}}],null,!1,138632224)}),a("el-table-column",{attrs:{label:"优惠价格","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[a("el-input",{on:{input:function(a){return t.inputVal(e.$index,e.row.preferentialPrice)}},model:{value:e.row.preferentialPrice,callback:function(a){t.$set(e.row,"preferentialPrice",a)},expression:"scope.row.preferentialPrice"}})],1)]}}],null,!1,2889499819)}),a("el-table-column",{attrs:{label:"单位","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.unit||"-"))])]}}],null,!1,2417366221)}),a("el-table-column",{attrs:{label:"数量",width:"250","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input-number",{attrs:{size:"mini",min:1},on:{change:function(a){return t.changeVal(e.$index,e.row.total)}},model:{value:e.row.total,callback:function(a){t.$set(e.row,"total",a)},expression:"scope.row.total"}})]}}],null,!1,414204674)}),a("el-table-column",{attrs:{label:"操作",align:"center",width:"120",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("i",{staticClass:"el-icon-delete",staticStyle:{cursor:"pointer",color:"red"},on:{click:function(a){return t.doDel(e.$index)}}})]}}],null,!1,2701437542)})],1)],1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.cancel}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.submit}},[t._v("确 定")])],1)]):t._e()],1)},n=[],o=a("5530"),i=a("c7eb"),r=a("1da1"),s=(a("14d9"),a("a434"),a("e9c4"),a("b64b"),a("d3b7"),a("159b"),a("943d")),c={name:"EitcErmPcAddTemplateDialog",data:function(){return{addTemplateDialogVisible:!1,tableData:[],deptOptions:[],defaultProps:{children:"childrenList",label:"costTypeName"},listInIds:"",dialogVisible:!1,tableDataDown:[]}},watch:{listInId:function(t){t&&(this.initcollectCostTypeList(),this.initList())}},mounted:function(){this.initcollectCostTypeList(),this.initList()},methods:{initcollectCostTypeList:function(){var t=this;return Object(r["a"])(Object(i["a"])().mark((function e(){var a;return Object(i["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["A"])();case 2:if(a=e.sent,200===a.code){e.next=5;break}return e.abrupt("return",t.$message.error(a.msg));case 5:t.deptOptions=a.data;case 6:case"end":return e.stop()}}),e)})))()},initList:function(){var t=this;return Object(r["a"])(Object(i["a"])().mark((function e(){var a;return Object(i["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["t"])({collectCostTypeId:t.listInIds});case 2:if(a=e.sent,200===a.code){e.next=5;break}return e.abrupt("return",t.$message.error(a.msg));case 5:t.tableData=a.data,t.tableData.forEach((function(t){return t.preferentialPrice=t.unitPrice,t})),t.$forceUpdate();case 8:case"end":return e.stop()}}),e)})))()},handleNodeClick:function(t,e,a){this.listInIds=t.id,e&&this.$refs.tree.getCheckedNodes().length>1&&this.$refs.tree.setCheckedNodes([t]),this.initList()},inputVal:function(t,e){this.$set(this.tableDataDown,t,Object(o["a"])(Object(o["a"])({},this.tableDataDown[t]),{},{preferentialPrice:e}))},changeVal:function(t,e){this.$set(this.tableDataDown,t,Object(o["a"])(Object(o["a"])({},this.tableDataDown[t]),{},{total:e}))},doAdd:function(t){var e=t;e.total=1,this.tableDataDown.push(e),this.$forceUpdate()},doDel:function(t){this.tableDataDown.splice(t,1)},cancel:function(){this.addTemplateDialogVisible=!1,this.tableDataDown=[]},submit:function(){var t=this;return Object(r["a"])(Object(i["a"])().mark((function e(){return Object(i["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(0!==t.tableDataDown.length){e.next=2;break}return e.abrupt("return",t.$message.error("请选择项目"));case 2:t.$emit("tableDataDown",JSON.parse(JSON.stringify(t.tableDataDown))),t.cancel(),t.addTemplateDialogVisible=!1;case 5:case"end":return e.stop()}}),e)})))()}}},u=c,d=(a("ba7b"),a("2877")),p=Object(d["a"])(u,l,n,!1,null,"b89fe3f2",null);e["default"]=p.exports}}]);