| | |
| | | new TreeVue({ |
| | | el: "#vbody", |
| | | data: { |
| | | dataname: "md_bu_product", // "md_prod_category", |
| | | title: "产品列表", |
| | | tree_title: "BU/产品", |
| | | dataname: "md_promotion", // "md_prod_category", |
| | | title: "过程定义", |
| | | tree_title: "过程", |
| | | treeTxtFormatter: "{name}", |
| | | isTreeReadonly: true, |
| | | |
| | | dataname_p: "md_prod_sku", |
| | | detail_title: "定义", |
| | | dataname_p: "md_promotion_process", |
| | | pagesize_p: 10, |
| | | pagenum_p: 1, |
| | | total_p: 0, |
| | |
| | | var buobj_ = {}; |
| | | var initTreeData = clone(me.initTreeData); |
| | | initTreeData.map(td=>{ |
| | | if (!buobj_[td.bu_id]) { |
| | | var bu_= { |
| | | id: td.bu_id, |
| | | bu_id: td.bu_id, |
| | | name: td.bu_name, |
| | | } |
| | | treeData_.push(bu_); |
| | | buobj_[td.bu_id] = bu_ |
| | | } |
| | | td.id = td.bu_id + "_" + td.product_id; |
| | | td.parent_id = td.bu_id; |
| | | td.name = td.product_name; |
| | | treeData_.push(td); |
| | | }) |
| | | |
| | | me.initTreeData = clone(treeData_) |
| | | |
| | | var orderArray = ["冠脉介入","神经介入","外周介入","血管内成像", "电生理"]; |
| | | let initTreeData_ = ArrayToTree(clone(me.initTreeData), "name", "parent_id", null, null, null, orderArray); |
| | | if (me.cbuttons_r.allocation) { |
| | | var notAllocationProduct = { |
| | | id: "notAllocationProduct", |
| | | name: "未分配产品" |
| | | } |
| | | initTreeData_.push(notAllocationProduct); |
| | | } |
| | | // var orderArray = ["冠脉介入","神经介入","外周介入","血管内成像", "电生理"]; |
| | | let initTreeData_ = ArrayToTree(clone(me.initTreeData), "name", "parent_id", null, null, null, null); |
| | | // if (me.cbuttons_r.allocation) { |
| | | // var notAllocationProduct = { |
| | | // id: "notAllocationProduct", |
| | | // name: "未分配产品" |
| | | // } |
| | | // initTreeData_.push(notAllocationProduct); |
| | | // } |
| | | |
| | | me.treeData = initTreeData_; |
| | | |
| | |
| | | } |
| | | |
| | | me.getTableMeta(); |
| | | |
| | | //待完善 |
| | | // if(me.treeData[0].children[0].children[0]) { |
| | | // let objInit = { |
| | | // data: clone(me.treeData[0].children[0].children[0]), |
| | | // node: {}, |
| | | // el: {}, |
| | | // }; |
| | | // me.onNodeClick(objInit); |
| | | // } |
| | | |
| | | //Brooke |
| | | // console.log(me.treeData); |
| | | // if(me.treeData[0]) { |
| | | // let objInit = me.findNodeInit(me.treeData[0]); |
| | | // console.log(objInit); |
| | | // } |
| | | |
| | | //GPT3.5 |
| | | // const deepestNode = me.findDeepestNode(me.treeData[0]); |
| | | // console.log(deepestNode); |
| | | |
| | | if(me.treeData[0]) { |
| | | const leafNode = me.findLeafNode(me.treeData[0]); |
| | | let objInit = { |
| | |
| | | onNodeClick(obj) { |
| | | console.log(obj); |
| | | var data = obj.data, node = obj.node, el = obj.el; |
| | | var filter_node_val = ""; |
| | | if (data.id == "notAllocationProduct") { // 未分配的产品 |
| | | filter_node_val = "NOT EXISTS ( SELECT * FROM md_bu_product where md_prod_sku.product_id = product_id)" |
| | | } |
| | | else if (!data.product_id) { |
| | | var filter_node_val_ = ""; |
| | | if (data.children && data.children.length) { |
| | | data.children.map(p=>{ |
| | | if (!filter_node_val_) { |
| | | filter_node_val_ = "('" + p.product_id; |
| | | } |
| | | else { |
| | | filter_node_val_ += "','" + p.product_id; |
| | | } |
| | | }) |
| | | filter_node_val_ += "')"; |
| | | } |
| | | if (filter_node_val_) { |
| | | filter_node_val = "md_prod_sku.product_id in " + filter_node_val_; |
| | | } |
| | | else { |
| | | filter_node_val = "1<>1" |
| | | } |
| | | } |
| | | else { |
| | | filter_node_val = "md_prod_sku.product_id='" + data.product_id + "'" |
| | | } |
| | | var filter_node_val = "parent_id='" + data.id + "'" |
| | | |
| | | // this.filterObjBydefault.category_name = val |
| | | this.selectedrow = data; |
| | |
| | | |
| | | }, |
| | | |
| | | // onNodeClick(data, node, el) { |
| | | // var val = data.name; |
| | | // if (data.children && data.children.length) { |
| | | // val = ""; |
| | | // data.children.map(r=>{ |
| | | // if (val == "") { |
| | | // val = r.name; |
| | | // } |
| | | // else { |
| | | // val += "','" + r.name; |
| | | // } |
| | | // }) |
| | | // } |
| | | |
| | | // // this.filterObjBydefault.category_name = val |
| | | // this.selectedrow = data; |
| | | // this.pagenum_p = 1; |
| | | // this.getDataByNode(); |
| | | // }, |
| | | |
| | | getDataByNode() { |
| | | var me = this; |
| | | if (!me.selectedrow.id) { |
| | |
| | | |
| | | var filter_ = ""; |
| | | |
| | | // filter_ = " product_line_name like '" + this.selectedrow.name + "' or authorize_category_name like '" + this.selectedrow.name + "'" |
| | | //filter_ = " code is not null and code <> '' and (authorize_category_id = '" + me.selectedrow.type_id + "' or authorize_category_name like '" + me.selectedrow.name + "')" |
| | | |
| | | filter_ = this.filter_node_val; |
| | | var param_ = { |
| | | dataname: me.dataname_p, |
| | | filter: filter_, |
| | | orderby: "md_prod_sku.product_name, md_prod_sku.spec", |
| | | orderby: "order_no", |
| | | page: { |
| | | pageno: me.pagenum_p, |
| | | pagesize: me.pagesize_p |
| | |
| | | <div> |
| | | <div style="height: 32px; border-bottom: 1px solid #aaa;"> |
| | | <div class="table_title" style="float: left;"> |
| | | <span>SKU列表</span> |
| | | <span>{{detail_title}}</span> |
| | | </div> |
| | | <!-- <div style=" text-align: right; "> |
| | | <el-button v-show="cbuttons_r.RuleValue" :disabled="!(setSelectedRowId)" @click="setRuleValue" >设置下单倍数</el-button> |