feeManage-legacy-614baee4.js 16 KB

1
  1. !function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function a(e){for(var a=1;a<arguments.length;a++){var l=null!=arguments[a]?arguments[a]:{};a%2?t(Object(l),!0).forEach((function(t){n(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):t(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function n(t,a,n){var l;return l=function(t,a){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var l=n.call(t,a||"default");if("object"!=e(l))return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===a?String:Number)(t)}(a,"string"),(a="symbol"==e(l)?l:String(l))in t?Object.defineProperty(t,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[a]=n,t}System.register(["./vendor-legacy-b96de472.js","./index-legacy-41fa6794.js","./LJWWData.vue_vue_type_style_index_0_scoped_1870765c_lang-legacy-38258497.js"],(function(e,t){"use strict";var n,l,i,r,o,s,c,u=document.createElement("style");return u.textContent=".btn-con[data-v-fefa2ca3]{padding-right:20px;text-align:right}.remind[data-v-fefa2ca3]{margin:20px}.remind .input-indent[data-v-fefa2ca3]{margin-left:22px}.delete-container[data-v-fefa2ca3]{padding:0 15px;font-size:13px;color:#999}.delete-container .delete-title[data-v-fefa2ca3]{line-height:80px;text-align:center;font-size:16px;color:#333}[data-v-fefa2ca3] .el-dialog__body{padding:10px}.fee-message[data-v-7200d489]{padding:1px 50px 30px;border-radius:8px;background-color:#fff}.guide[data-v-7200d489]{width:100%;display:flex;flex-direction:column;align-items:center;margin:150px auto 0}.container[data-v-7200d489]{margin-top:30px}.container .container-title[data-v-7200d489]{display:flex;justify-content:space-between;color:#1651ee;padding:15px 20px;background-image:linear-gradient(rgba(38,92,240,.1),rgba(38,92,240,.04));border-radius:8px 8px 0 0;align-items:center;margin-bottom:10px}.container .container-static[data-v-7200d489]{line-height:32px;font-size:14px;color:#666}.container .container-static .unit[data-v-7200d489]{margin-left:15px;font-size:13px;color:#999}\n",document.head.appendChild(u),{setters:[function(e){n=e.r,l=e.e,i=e.i,r=e.h,o=e.o},function(e){s=e.n,c=e.$},function(){}],execute:function(){var t=s({__name:"editFeeDialog",emits:["updateData"],setup:function(e,t){var a=t.expose,i=t.emit,r=n(!1),o=n(!1),s=n([]),c=n([]),u=n(!1),d=n(1),p=n({}),f=n(!1),v=n([]),m=n([]),g=n("");function b(e,t){console.log("editFee",e),v.value=[],c.value=[],s.value=JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(e)),e.map((function(e){e.children.map((function(t){t.parent_id=e.id,t.parent_name=e.field_name})),c.value.push(e)})),m.value=h(c.value),g.value=0==+t?"营业额":1==+t?"变动费用":"固定费用",r.value=!0}function h(e){return e.filter((function(e){return 1!==e.del_flag&&(Array.isArray(e.children)&&(e.children=h(e.children)),!0)}))}return a({init:b}),{__sfc:!0,dialogVisible:r,deleteDialogVisible:o,emits:i,totalData:s,tableData:c,isLoading:u,addNum:d,currData:p,checked:f,deletedIds:v,showData:m,project_name:g,init:b,filterItems:h,addData:function(){c.value.unshift({id:"add".concat(2*d.value),field_name:null,del_flag:0,children:[{id:"add".concat(2*d.value+1),field_name:null,del_flag:0,parent_id:"add".concat(2*d.value)}]}),d.value++,m.value=h(c.value)},deleteData:function(e){console.log("deleteData",c.value,e),o.value=!0,f.value=!1,p.value=e,e.parent_id&&(p.value.parent_num=c.value.filter((function(t){return t.id===e.parent_id}))[0].children.length)},doDelete:function(){var e={};c.value.map((function(t){t.id===p.value.id&&(e=t),t.children.map((function(t){t.id===p.value.id&&(e=t)}))})),console.log("doDelete data",e),console.log("tableData.value",c.value),e.del_flag=1,String(e.id).includes("add")||v.value.push(e.id),f.value&&(c.value.filter((function(e){return e.id===p.value.parent_id}))[0].del_flag=1),m.value=h(c.value),o.value=!1},saveForm:function(){c.value.map((function(e){String(e.id).includes("add")&&delete e.id,e.children=e.children.filter((function(e){return e.field_name})).map((function(e){String(e.id).includes("add")&&delete e.id}))}));var e=c.value.filter((function(e){return!e.id}));s.value=s.value.concat(e),s.value.map((function(e){v.value.includes(e.id)&&(e.del_flag=1),e.children.map((function(e){v.value.includes(e.id)&&(e.del_flag=1)}))})),HTTP.post("batch_business_data",{bd_list:s.value,project_name:g.value}).then((function(e){u.value=!1,console.log("res",e),0===e.code?(l.exports.Message({type:"success",message:"保存成功"}),r.value=!1,i("updateData")):l.exports.Message({type:"error",message:e.msg})}))}}}},(function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{staticClass:"clue-details"},[t("el-dialog",{attrs:{"append-to-body":!0,title:"配置信息",visible:a.dialogVisible,width:"600px",top:"10vh"},on:{"update:visible":function(e){a.dialogVisible=e}}},[t("div",{staticClass:"remind"},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:a.showData,"default-expand-all":"","row-key":"id","tree-props":{children:"children"},indent:30,height:"50vh","header-cell-style":{background:"#F6FAFF"}}},[t("el-table-column",{attrs:{prop:"manager",label:"变动项"},scopedSlots:e._u([{key:"default",fn:function(a){var n=a.row;return[t("el-input",{class:{"input-indent":n.children&&!n.children.length},staticStyle:{width:"250px"},attrs:{size:"small"},model:{value:n.field_name,callback:function(t){e.$set(n,"field_name",t)},expression:"row.field_name"}})]}}])}),t("el-table-column",{attrs:{prop:"address",label:"操作",width:"80"},scopedSlots:e._u([{key:"default",fn:function(n){var l=n.row;return[l.children&&l.children.length?e._e():t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:61204,expression:"61204"}],attrs:{type:"text"},on:{click:function(e){return a.deleteData(l)}}},[e._v(" 删除 ")])]}}])})],1)],1),t("span",{staticClass:"dialog-footer",staticStyle:{display:"flex"},attrs:{slot:"footer"},slot:"footer"},[t("div",{staticStyle:{"margin-right":"auto"}},[t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:61205,expression:"61205"}],attrs:{type:"text",loading:a.isLoading},on:{click:a.addData}},[e._v(" + 新增变动项 ")])],1),t("el-button",{on:{click:function(e){a.dialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",loading:a.isLoading},on:{click:a.saveForm}},[e._v(" 确 定 ")])],1)]),t("el-dialog",{attrs:{"append-to-body":!0,title:"提示",visible:a.deleteDialogVisible,width:"500px"},on:{"update:visible":function(e){a.deleteDialogVisible=e}}},[t("div",{staticClass:"delete-container"},[t("div",{staticClass:"delete-title"},[e._v(" 确定删除类型【"+e._s(a.currData.field_name)+"】? ")]),a.currData.parent_id&&1===a.currData.parent_num?t("div",{staticStyle:{margin:"10px 0"}},[t("el-checkbox",{model:{value:a.checked,callback:function(e){a.checked=e},expression:"checked"}},[e._v(" 同时删除类型【"+e._s(a.currData.parent_name)+"】 ")])],1):e._e()]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(e){a.deleteDialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",loading:a.isLoading},on:{click:a.doDelete}},[e._v(" 确 定 ")])],1)])],1)}),[],!1,null,"fefa2ca3",null,null).exports;e("default",s({__name:"feeManage",setup:function(e){var s=n(),u=n([[],[],[]]),d=n([[],[],[]]),p=n([[],[],[]]),f=n([]),v=n([]),m=n(!0),g=i({limit:9999,offset:0,del_flag:0,ordering:"weight"}),b=n(r((function(){return c.getters.appMainHeight-111-104}))),h=n(!1);function y(e,t){return a(a({},e),t)}function _(e,t,a){var n={},l={};e[0].map((function(e,t){n["key"+(t+1)]=e[0]})),e[1].map((function(e,t){l["val"+(t+1)]=e[0]})),t.push(y(n,l)),a.push([[1,e[0].length],[0,0],[0,0]])}function x(e,t,a,n,l,i,r){var o={id:a[a.length-1].id},s={},c=[];n[0].map((function(e,t){o["key"+(t+1)]=l>t?a[t][e[1]]:""})),console.log("object_keys",o),console.log("item_list",a),n[1].map((function(e,t){s["val"+(t+1)]=a[a.length-1][e[1]]})),e.push(y(o,s)),1==l?n[0].map((function(e,t){l>t?c.push([1,n[0].length]):c.push([0,0])})):2==l?n[0].map((function(e,t){0==t?0==i[1]?c.push([r[t],1]):c.push([0,0]):1==t?c.push([1,n[0].length-1]):c.push([0,0])})):n[0].map((function(e,t){0==t?0==i[1]&&0==i[2]?c.push([r[t],1]):c.push([0,0]):1==t&&(0==i[2]?c.push([r[t],1]):c.push([0,0]))})),console.log("index_list:",i),console.log("merge_list:",c),t.push(c)}function w(e,t,a,n){_(t,a,n),e.map((function(e,l){if(e.children&&e.children.length){var i=0;e.children.map((function(e){e.children&&e.children.length?i+=e.children.length:i+=1})),e.children.map((function(r,o){if(r.children&&r.children.length){var s=0;r.children.map((function(e){e.children&&e.children.length?s+=e.children.length:s+=1})),r.children.map((function(c,u){x(a,n,[e,r,c],t,3,[l,o,u],[i,s])}))}else x(a,n,[e,r],t,2,[l,o,0],[i,0])}))}else x(a,n,[e],t,1)}))}function D(){m.value=!0,g.bd_year=(new Date).getFullYear(),HTTP.get("business_data_fields_frame",g).then((function(e){if(0!=e.data.results.length){var t=[[["项目","field_name"],["","field_name"],["","field_name"]],[["数据来源","source"],["经营数据(元)","bd_money"]]];p.value[0]=e.data.results[0].children,p.value[1]=e.data.results[1].children,p.value[2]=e.data.results[3].children,w([e.data.results[0]],t,u.value[0],d.value[0]),w([e.data.results[1]],t,u.value[1],d.value[1]),w([e.data.results[3]],t,u.value[2],d.value[2]),console.log("tableDataList:",u.value)}})).finally((function(){setTimeout((function(){return m.value=!1}),500)}))}return o((function(){m.value=!0,D()})),{__sfc:!0,editRef:s,tableDataList:u,mergeDataList:d,tableResultList:p,tableData:f,mergeData:v,loading:m,filter:g,tableHeight:b,isEdit:h,initColumnData:y,initMeterHeader:_,dealMergeKey:x,mergeTableProcessing:w,dealTotalMoney:function(e){if(console.log("money",u.value[e]),u.value[e]){var t=0;return u.value[e].map((function(e){t+=+e.val1||0,t+=+e.val2||0})),t}},getTableData:D,arraySpanMethod1:function(e){e.row,e.column;var t=e.rowIndex,a=e.columnIndex;if(t<d.value[0].length&&a<d.value[0][t].length)return d.value[0][t][a]},arraySpanMethod2:function(e){e.row,e.column;var t=e.rowIndex,a=e.columnIndex;if(t<d.value[1].length&&a<d.value[1][t].length)return d.value[1][t][a]},arraySpanMethod3:function(e){e.row,e.column;var t=e.rowIndex,a=e.columnIndex;if(t<d.value[2].length&&a<d.value[2][t].length)return d.value[2][t][a]},showEdit:function(e){s.value.init(p.value[e],e)},editNum:function(e){console.log("data",e),l.exports.MessageBox.prompt("请输入修改金额","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:e.val2}).then((function(t){var a=t.value;a&&HTTP.patch("business_data_fields",{id:e.id,bd_money:a}).then((function(t){0===t.code?(l.exports.Message({type:"success",message:"修改成功"}),e.val2=a):l.exports.Message({type:"error",message:t.msg})}))})).catch((function(){}))},editDialog:t}}},(function(){var e=this,t=e._self._c,a=e._self._setupProxy;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:a.loading,expression:"loading"}],staticClass:"fee-message"},[a.tableDataList[0].length>0||a.tableDataList[1].length>0||a.tableDataList[2].length>0?t("div",[t("div",{staticClass:"container"},[t("div",{staticClass:"container-title"},[e._v(" 营业额 "),t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:61202,expression:"61202"}],staticClass:"btn",attrs:{type:"primary"},on:{click:function(e){return a.showEdit(0)}}},[e._v("配置 ")])],1),t("div",{staticClass:"container-static"},[e._v(" 总计:"+e._s(a.dealTotalMoney(0))+" "),t("span",{staticClass:"unit"},[e._v("单位(元)")])]),t("el-table",{attrs:{"show-header":!1,data:a.tableDataList[0],"span-method":a.arraySpanMethod1,border:"","header-cell-style":{background:"#F6FAFF"}}},[t("el-table-column",{attrs:{align:"center",prop:"key1",label:"一级",width:"180"}}),t("el-table-column",{attrs:{align:"center",prop:"key2",label:"二级"}}),t("el-table-column",{attrs:{align:"center",prop:"key3",sortable:"",label:"三级"}}),t("el-table-column",{attrs:{prop:"val1",sortable:"",label:"数据来源"}}),t("el-table-column",{attrs:{align:"center",prop:"val2",sortable:"",label:"金额"}}),t("el-table-column",{attrs:{align:"center",sortable:"",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(n){return[n.$index?t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:61203,expression:"61203"}],attrs:{type:"text"},on:{click:function(e){return a.editNum(n.row)}}},[e._v(" 修改金额 ")]):e._e()]}}],null,!1,1568927192)})],1)],1),t("div",{staticClass:"container"},[t("div",{staticClass:"container-title"},[e._v(" 变动费用 "),t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:53102,expression:"53102"}],staticClass:"btn",attrs:{type:"primary"},on:{click:function(e){return a.showEdit(1)}}},[e._v("配置 ")])],1),t("div",{staticClass:"container-static"},[e._v(" 总计:"+e._s(a.dealTotalMoney(1))+" "),t("span",{staticClass:"unit"},[e._v("单位(元)")])]),t("el-table",{attrs:{"show-header":!1,data:a.tableDataList[1],"span-method":a.arraySpanMethod2,border:"","header-cell-style":{background:"#F6FAFF"}}},[t("el-table-column",{attrs:{align:"center",prop:"key1",label:"一级",width:"180"}}),t("el-table-column",{attrs:{align:"center",prop:"key2",label:"二级"}}),t("el-table-column",{attrs:{align:"center",prop:"key3",sortable:"",label:"三级"}}),t("el-table-column",{attrs:{prop:"val1",sortable:"",label:"数据来源"}}),t("el-table-column",{attrs:{align:"center",prop:"val2",sortable:"",label:"金额"}}),t("el-table-column",{attrs:{align:"center",sortable:"",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(n){return[n.$index?t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:61203,expression:"61203"}],attrs:{type:"text"},on:{click:function(e){return a.editNum(n.row)}}},[e._v(" 修改金额 ")]):e._e()]}}],null,!1,1568927192)})],1)],1),t("div",{staticClass:"container"},[t("div",{staticClass:"container-title"},[e._v(" 固定费用 "),t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:53102,expression:"53102"}],staticClass:"btn",attrs:{type:"primary"},on:{click:function(e){return a.showEdit(2)}}},[e._v("配置 ")])],1),t("div",{staticClass:"container-static"},[e._v(" 总计:"+e._s(a.dealTotalMoney(2))+" "),t("span",{staticClass:"unit"},[e._v("单位(元)")])]),t("el-table",{attrs:{"show-header":!1,data:a.tableDataList[2],"span-method":a.arraySpanMethod3,border:"","header-cell-style":{background:"#F6FAFF"}}},[t("el-table-column",{attrs:{align:"center",prop:"key1",label:"一级",width:"180"}}),t("el-table-column",{attrs:{align:"center",prop:"key2",label:"二级"}}),t("el-table-column",{attrs:{align:"center",prop:"key3",sortable:"",label:"三级"}}),t("el-table-column",{attrs:{prop:"val1",sortable:"",label:"数据来源"}}),t("el-table-column",{attrs:{align:"center",prop:"val2",sortable:"",label:"金额"}}),t("el-table-column",{attrs:{align:"center",sortable:"",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(n){return[n.$index?t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:61203,expression:"61203"}],attrs:{type:"text"},on:{click:function(e){return a.editNum(n.row)}}},[e._v(" 修改金额 ")]):e._e()]}}],null,!1,1568927192)})],1)],1)]):t("div",{staticClass:"guide"},[t("img",{attrs:{src:"/png/img_feiygl-7ce79ea5.png",alt:""}}),t("div",{staticStyle:{"margin-top":"15px","font-size":"16px",color:"#919398"}},[e._v("所有的费用一目了然")])]),t(a.editDialog,{ref:"editRef",on:{updateData:a.getTableData}})],1)}),[],!1,null,"7200d489",null,null).exports)}}}))}();