snow 2 lat temu
rodzic
commit
a3a0e0a8d2

+ 29 - 8
src/components/flow-chart/utils/createProcessData.js

@@ -11,6 +11,7 @@ function createNode(raw, level = 0, index = 0, max = 0, _middle = -1) {
   if (_index > middle && max !== 0) x = MIDDMLE_X + (_index * GAP_X)
   if (_index < middle && max !== 0) x = MIDDMLE_X - (_index * GAP_X)
 
+
   return ({
     id: raw.order_process,
     text: raw.status_name,
@@ -72,8 +73,10 @@ function createNodes(source, startNode) {
       const node = createNode(current, level, index, maxLength, _middle);
       const prevSameNodeIndex = nodesRaw.findIndex(({ text }) => text === node.text);
       if (prevSameNodeIndex >= 0) nodesRaw.splice(prevSameNodeIndex, 1);
+      
       nodesRaw.push(node);
       edgesRaw.push(edge);
+      
       if (current.next_actions.length > 0) convert(current, current.order_process, level);
     }
   }
@@ -89,7 +92,7 @@ function createNodesWithRecord(nodesRaw, edgesRaw, record) {
     const current = record[i];
     const next = record[i + 1];
     const isLast = i === record.length - 1;
-    const sourceNodeIndex = nodesRaw.findIndex(({ id }) => id === current.order_process);
+    const sourceNodeIndex = nodesRaw.findIndex(({ id }) => String(id) === String(current.order_process));
 
     if (sourceNodeIndex >= 0) {
       nodesRaw[sourceNodeIndex].type = isLast ? 'ProcessTask' : 'StartTask';
@@ -99,7 +102,6 @@ function createNodesWithRecord(nodesRaw, edgesRaw, record) {
       }
     }
 
-
     const sourceEdgeIndex = edgesRaw.findIndex(({ sourceNodeId, targetNodeId }) => {
       return String(sourceNodeId) === String(current?.order_process) && String(targetNodeId) === String(next?.order_process);
     })
@@ -111,11 +113,6 @@ function createNodesWithRecord(nodesRaw, edgesRaw, record) {
     if (sourceEdgeIndex >= 0) edgesRaw[sourceEdgeIndex].type = 'polyline';
   }
 
-  console.log({
-    edges: edgesRaw,
-    nodes: nodesRaw
-  })
-
   return {
     edges: edgesRaw,
     nodes: nodesRaw
@@ -123,9 +120,33 @@ function createNodesWithRecord(nodesRaw, edgesRaw, record) {
 }
 
 
-export function createProcessData(source, record) {
+
+function generateTargetStartNode(soruceStartNode){
+  const startNode = {
+    action_type :  "1",
+    addtime : "",
+    creater:  "",
+    id:  "-1",
+    is_master : "1",
+    next_action_ids: "",
+    next_actions :  [soruceStartNode.status_name],
+    operation_type : "2",
+    order_process :  "-1",
+    remark : "",
+    status : "-1",
+    status_name :  "创建",
+  }
+
+  return startNode
+}
+
+
+export function createProcessData(_source, record) {
+  console.log(record)
   record = uniqueRecordData(record)
   const processChart = { nodes: [], edges: [] }
+  const sourceStartIndex = _source.findIndex(({ action_type }) => action_type == '1')
+  const source = [generateTargetStartNode(_source[sourceStartIndex]),..._source]
   const { start, startRaw } = createStartNode(source);
   const { nodesRaw: _nodesRaw, edgesRaw } = createNodes(source, startRaw);
   const nodesRaw = [start, ..._nodesRaw];

+ 0 - 2
src/components/flow-chart/utils/tooltip.js

@@ -54,9 +54,7 @@ export class Tooltip {
   getTootipPosition() {
     const data = this._activeData;
     const Model = this.lf?.graphModel.getElement(data.id);
-
     let x, y;
-
     if (Model?.BaseType === 'node') {
       x = data.x + Model.width / 2;
       y = data.y - Model.height + 5;

+ 3 - 2
src/components/globalComponents/show-goods-data-table/main.vue

@@ -2,7 +2,7 @@
   <div v-loading="loading" class="showGoodsDataTable">
     <show-data-table
       v-if="
-        (type + '' === '1' || type + '' === '2' || type + '' === '5' || type + '' === '6') &&
+        (type === '0' ||type + '' === '1' || type + '' === '2' || type + '' === '5' || type + '' === '6') &&
           this.sitem &&
           this.sitem.addtime &&
           !iscgd
@@ -130,7 +130,7 @@
     </show-data-table>
     <show-data-table
       v-else-if="
-        (type + '' === '1' || type + '' === '2' || type + '' === '5' || type + '' === '6') &&
+        (type + '' === '0' ||type + '' === '1' || type + '' === '2' || type + '' === '5' || type + '' === '6') &&
           this.sitem &&
           this.sitem.addtime &&
           iscgd
@@ -544,6 +544,7 @@ export default {
       if (this.type) {
         let res = {}
         if (
+          this.type + '' === '0' ||
           this.type + '' === '1' ||
           this.type + '' === '2' ||
           this.type + '' === '5' ||

+ 0 - 1
src/permission.js

@@ -59,6 +59,5 @@ router.beforeEach(async(to, from, next) => {
 })
 
 router.afterEach(() => {
-  // finish progress bar
   NProgress.done()
 })

+ 1 - 1
src/views/purchaseIn/wsmInOrder/detail.vue

@@ -107,7 +107,7 @@
             :orderCode="queryId"
           />
         </el-tab-pane>
-        <el-tab-pane label="流程图" name="4" v-if="sitem.sendtype !== '2'">
+        <el-tab-pane label="流程图" name="4">
           <flow-chart process_id="2" type="RKD" :orderCode="queryId" />
         </el-tab-pane>
       </el-tabs>

+ 25 - 2
src/views/sellOut/salesOrder/index.vue

@@ -56,8 +56,31 @@
                     :label="item.label"
                     :value="item.id"
                   />
-            </el-select>
+              </el-select>
+            </el-col>
+            <el-col :span="4" style="width: 150px; padding: 0 0 0 9px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.use_type"
+                  filterable
+                  clearable
+                  placeholder="对接类型"
+                  style="width: 100%"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in [{id: 1, label: 'toB'}, {id: 2, label: 'ToC'}]"
+                    :key="'use_type' + item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  />
+                </el-select>
               </el-col>
+
               <!-- 客户公司 -->
               <!-- <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
                 <search-work-company
@@ -66,7 +89,7 @@
                   :size="'mini'"
                   :placeholder="'销售方公司'"
                   :disabled="false"
-                  :isDetail="false"
+                  :isDetail="false"                  
                   @searchChange="supplierChange"
                 />
               </el-col> -->

+ 0 - 1
src/views/sellOut/sellAfterApply/components/wait-stockman.vue

@@ -132,7 +132,6 @@ export default {
         if (!this.sitem || !this.sitem.outCode) {
           return
         }
-
         const { data, code, message } = await asyncRequest.afterChild({ returnCode: this.sitem.returnCode, is_authority: '0' })
         switch (code) {
           case 0:

+ 4 - 4
src/views/sellOut/sellAfterApply/detail.vue

@@ -102,7 +102,7 @@
                         ) || {}
                       ).name || '--'
                     "
-                  ></el-tag>
+                  />
                 </template>
 
                 <template slot="order_type">
@@ -164,7 +164,7 @@
             </el-collapse-item>
 
             <el-collapse-item title="售后申请工单" name="10" v-if="sitem.status === '5'">
-                <show-work-order :sitem="sitem"  />
+              <show-work-order :sitem="sitem"  />
             </el-collapse-item>
 
             <el-collapse-item title="商品信息" name="2">
@@ -221,9 +221,9 @@
             :orderCode="orderCode"
           />
         </el-tab-pane>
-
+<!-- 
       <el-tab-pane label="流程图" name="3"  v-if="newTime !== ''">
-       </el-tab-pane>
+       </el-tab-pane> -->
 
        <el-tab-pane label="流程图(按执行角色区分)" name="4"  style="width:100%">
           <img src="~@/assets/afterSale.jpg" />

+ 2 - 2
src/views/sellOut/sellReturn/detail.vue

@@ -217,9 +217,9 @@
           />
         </el-tab-pane>
 
-        <el-tab-pane label="流程图" name="3">
+        <!-- <el-tab-pane label="流程图" name="3">
           <flow-chart ref="flowChart" />
-        </el-tab-pane>
+        </el-tab-pane> -->
 
         <el-tab-pane label="流程图(按执行角色区分)" name="4">
           <img src="~@/assets/beforeSale.jpg" style="width:100%" />

+ 0 - 7
src/views/sellOut/sellReturn/index.vue

@@ -390,12 +390,6 @@ export default {
     if (back) {
       this.parmValue = JSON.parse(back);
       const { page, size } = this.parmValue;
-      // this.parmValue.start = start || last_start;
-      // this.parmValue.end = end || last_end;
-      // if(this.parmValue.companyNo.length>0){
-      //     this.customerCode = [this.parmValue.companyNo] ;
-      // }
-
       this.pageInfo = {
         size: size,
         curr: page,
@@ -407,7 +401,6 @@ export default {
       this.s_input = this.parmValue.s_input;
     } else {
       this.select = "returnCode";
-      //  this.sselect = "创建时间"
     }
     this.searchList();
   },

+ 80 - 81
src/views/standingBook/anchBook/anchor.vue

@@ -9,158 +9,157 @@
       <div class="anchor-link" :style="{ height: getAnchorLinkHeight }">
         <AnchorLink
           :data="data"
+          :current-anchor="currentAnchor"
           @goAnchor="goAnchor"
-          :currentAnchor="currentAnchor"
-        ></AnchorLink>
+        />
       </div>
     </div>
     <div ref="anchor-body" class="anchor-body" @scroll="scrollEvent($event)">
-      <slot></slot>
+      <slot />
     </div>
   </div>
 </template>
 <script>
-import AnchorLink from "./anchorItem.vue"
+import AnchorLink from './anchorItem.vue'
 export default {
+  components: {
+    AnchorLink
+  },
   props: {
     float: Boolean,
     placement: {
       type: String,
-      default: "leftTop",
+      default: 'leftTop'
     },
     itemHeight: {
       type: Number,
-      default: 180,
+      default: 180
     },
     data: {
       type: Array,
-      default: () => [],
+      default: () => []
     },
     height: {
       type: String,
-      default: "600px",
-    },
+      default: '600px'
+    }
   },
-  components: {
-    AnchorLink,
+  data() {
+    return {
+      currentAnchor: '',
+      oldHeight: 0,
+      scorllTimer: null,
+      allAnchor: [],
+      offset: 0
+    }
   },
   computed: {
-      //获取所有锚点组合的锚点高度
+    // 获取所有锚点组合的锚点高度
     getAnchorLinkHeight() {
-      let childrenHeight = 0;
+      let childrenHeight = 0
       this.data.forEach((ele) => {
         if (ele.children && ele.children.length > 0) {
-          childrenHeight += ele.children.length * 30;
+          childrenHeight += ele.children.length * 30
         }
-      });
-      console.log(childrenHeight + 30 * this.data.length - 20 + "px")
-      return (childrenHeight + 30) * (this.data.length - 20) + "px";
+      })
+      console.log(childrenHeight + 30 * this.data.length - 20 + 'px')
+      return (childrenHeight + 30) * (this.data.length - 20) + 'px'
     },
-    //获取所有锚点组合的位置
+    // 获取所有锚点组合的位置
     getHeaderPosition() {
       switch (this.placement) {
-        case "leftTop":
-          return "placement-left-top";
-        case "leftCenter":
-          return "placement-left-center";
-        case "leftBottom":
-          return "placement-left-bottom";
-        case "rightTop":
-          return "placement-right-top";
-        case "rightCenter":
-          return "placement-right-center";
-        case "rightBottom":
-          return "placement-right-bottom";
+        case 'leftTop':
+          return 'placement-left-top'
+        case 'leftCenter':
+          return 'placement-left-center'
+        case 'leftBottom':
+          return 'placement-left-bottom'
+        case 'rightTop':
+          return 'placement-right-top'
+        case 'rightCenter':
+          return 'placement-right-center'
+        case 'rightBottom':
+          return 'placement-right-bottom'
         default:
-          return "";
+          return ''
       }
-    },
+    }
   },
   watch: {
-      //监听数据变化,获取所有锚点(方便后面计算),获取第一个锚点的偏差
-      //(因为offset计算的是当前容器被卷去的高度,可能你的高度存在偏差,所以需要减去)
+    // 监听数据变化,获取所有锚点(方便后面计算),获取第一个锚点的偏差
+    // (因为offset计算的是当前容器被卷去的高度,可能你的高度存在偏差,所以需要减去)
     data: {
       handler(val) {
         if (val && val.length > 0) {
-          this.allAnchor = this.getAllAnchor(val);
-          //偏差
+          this.allAnchor = this.getAllAnchor(val)
+          // 偏差
           this.$nextTick(() => {
-            var anchor = document.querySelector(val[0].tar);
-            this.offset = anchor.offsetTop;
-          });
+            var anchor = document.querySelector(val[0].tar)
+            this.offset = anchor.offsetTop
+          })
         }
       },
       deep: true,
-      immediate: true,
-    },
-  },
-  data() {
-    return {
-      currentAnchor: "",
-      oldHeight: 0,
-      scorllTimer: null,
-      allAnchor: [],
-      offset: 0,
-    };
+      immediate: true
+    }
   },
   methods: {
-      //递归获取所有锚点的值
+    // 递归获取所有锚点的值
     getAllAnchor(anchor) {
-      let anchorTree = [];
+      const anchorTree = []
       anchor.forEach((ele) => {
-        anchorTree.push({ tar: ele.tar, title: ele.title });
+        anchorTree.push({ tar: ele.tar, title: ele.title })
         if (ele.children && ele.children.length > 0) {
-          anchorTree.push(...this.getAllAnchor(ele.children));
+          anchorTree.push(...this.getAllAnchor(ele.children))
         }
-      });
-      return anchorTree;
+      })
+      return anchorTree
     },
-    //点击锚点滚动
+    // 点击锚点滚动
     goAnchor(selector) {
-      //将原来的scrollTimer变为现在的scorllClick  防止滚动条滚动多次触发
-      this.scorllClick = true;
-      this.currentAnchor = selector;
-      var anchor = document.querySelector(selector);
-      this.$refs["anchor-body"].scrollTop = anchor.offsetTop-50;
+      // 将原来的scrollTimer变为现在的scorllClick  防止滚动条滚动多次触发
+      this.scorllClick = true
+      this.currentAnchor = selector
+      var anchor = document.querySelector(selector)
+      this.$refs['anchor-body'].scrollTop = anchor.offsetTop - 50
       this.allAnchor.forEach((ele, i) => {
         if (ele.tar === selector) {
           // this.$refs["anchor-icon"].style.display = "block";
           // this.$refs["anchor-icon"].style.top = i * 30 + 2 + "px";
         }
-      });
-      this.scorllClick = false;
-
+      })
+      this.scorllClick = false
     },
-    //页面滚动, 判断当前的scrollTop在哪个锚点之间,修改锚点的样式
+    // 页面滚动, 判断当前的scrollTop在哪个锚点之间,修改锚点的样式
     scrollEvent() {
       if (this.scorllClick) {
-        return;
-      }  
+        return
+      }
       if (this.scorllTimer != null) {
-        return;
+        return
       }
-      //当前滚动位置
-      let scrollTop = this.$refs["anchor-body"].scrollTop;
+      // 当前滚动位置
+      const scrollTop = this.$refs['anchor-body'].scrollTop
       // console.log(scrollTop)
-      
+
       this.allAnchor.forEach((ele, i) => {
-        let dom = document.querySelector(ele.tar);
+        const dom = document.querySelector(ele.tar)
         if (dom) {
           if (
-            scrollTop > dom.offsetTop-80
-         
+            scrollTop > dom.offsetTop - 80
+
           ) {
-            this.currentAnchor = ele.tar;
+            this.currentAnchor = ele.tar
             // this.currentAnchor = this.allAnchor[i+1].tar;
             // this.$refs["anchor-icon"].style.display = "block";
             // this.$refs["anchor-icon"].style.top = i * 30 + 2 + "px";
-            return;
+            return
           }
         }
-      });
-    },
-  },
-};
+      })
+    }
+  }
+}
 </script>
 <style lang="scss" scoped>
 .cec-anchor {

+ 11 - 11
src/views/standingBook/anchBook/anchorItem.vue

@@ -13,35 +13,35 @@
         v-if="item.children && item.children.length > 0"
         class="anchor-link-group"
       >
-      <!-- 递归当前组件,对应的props 及方法一定要带上,否则不生效 -->
+        <!-- 递归当前组件,对应的props 及方法一定要带上,否则不生效 -->
         <AnchorLink
           :data="item.children"
+          :current-anchor="currentAnchor"
           @goAnchor="goAnchor"
-          :currentAnchor="currentAnchor"
-        ></AnchorLink>
+        />
       </div>
     </div>
   </div>
 </template>
 <script>
 export default {
-  name: "AnchorLink",
+  name: 'AnchorLink',
   props: {
     data: {
       type: Array,
-      default: () => [],
+      default: () => []
     },
     currentAnchor: {
       type: String,
-      default: "",
-    },
+      default: ''
+    }
   },
   methods: {
     goAnchor(tar) {
-      this.$emit("goAnchor", tar);
-    },
-  },
-};
+      this.$emit('goAnchor', tar)
+    }
+  }
+}
 </script>
 <style lang="scss" scoped>
 a {

+ 1 - 1
src/views/standingBook/components/detail3/columns.js

@@ -163,7 +163,7 @@ const listColumns = [
 
   {
     prop: 'order_type',
-    label: '备货单',
+    label: '商品类型',
     _slot_: 'order_type',
     width: '130px'
   },