瀏覽代碼

tMerge branch 'master' of https://git.7in6.com/Minong/mes-admin-backend-ui

曹鹤洋 1 年之前
父節點
當前提交
40710b5928

+ 37 - 19
src/view/yunyin/chanpinziliao/chanpinziliao.vue

@@ -598,11 +598,19 @@
               <!--            <el-tree :data="treeData" @node-click="handleNodeClick" @node-expand="handleNodeExpand">-->
               <!--              <template #default="{node,data}">{{data['客户编号']}}【{{data['客户名称']}}】</template>-->
               <!--            </el-tree>-->
-              <el-tree :data="treeData" node-key="label" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
-                <template #default="{ node, data }">
-                  {{ node.label }}
+              <el-tree :data="treeData" class="treecolor" node-key="label" @node-click="handleNodeClick">
+                <template #default="{  node, data  }">
+                  <div :style="{ color: node.label === selectedLabel ? 'red' : '' }">
+                    {{ node.label }}
+                  </div>
                 </template>
               </el-tree>
+<!--              <el-tree :data="treeData"  class="treecolor" node-key="label"  @node-click="handleNodeClick" @node-expand="handleNodeExpand">-->
+<!--                <template #default="{ node, data }">-->
+<!--                  {{ node.label }}-->
+<!--                </template>-->
+<!--              </el-tree>-->
+
             </div>
           </layout-sider>
 
@@ -782,8 +790,8 @@
               </el-table>
             </el-tab-pane>
           </el-tabs>
-		  
-		  
+
+
 		  <el-dialog
 		    v-model="huanxingVisible"
 		    title="选择客户代号"
@@ -803,7 +811,7 @@
 		            </el-tree>
 		          </div>
 		        </el-aside>
-		      </div>	    
+		      </div>
 		    </div>
 		  </el-dialog>
 
@@ -2050,7 +2058,7 @@ const cpgyfzhandleConfirm = async () => {
     toProUpperCase.value = cpgyfzformData['to_pro'];
   } else {
     // 如果不是大写字母,则将其转换为大写
-    toProUpperCase.value  = cpgyfzformData['to_pro'].toUpperCase();    
+    toProUpperCase.value  = cpgyfzformData['to_pro'].toUpperCase();
   }
   const formattedData = {
     from_code: cpgyfzformData['process'],
@@ -2514,21 +2522,31 @@ const getCustomdata = async () => {
     console.error('Error fetching custom data:', error);
   }
 }
+
 getCustomdata()
 
 //点击左侧树形获取列表
 const tableData = reactive([])
 const _custom_code = ref(null)
+const selectedLabel = ref(null);
+
 const handleNodeClick = async (node) => {
-  if(node.label === '印刷产品' || node.label === '糊盒产品'){
-    tableData.splice(0);
-    return false;
+  // if(node.label === '印刷产品' || node.label === '糊盒产品'){
+  //   tableData.splice(0);
+  //   return false;
+  // }
+  if(node.label === '印刷产品' ){
+    _custom_code.value = 'Y';
+  }else if(node.label === '糊盒产品'){
+    _custom_code.value = 'J';
+  }else{
+    _custom_code.value = node.客户编号;
   }
-  console.log(node.客户编号)
-  _custom_code.value = node.客户编号;
   //清空搜索框
   searchInfo.value = '';
   _getProduct()
+  selectedLabel.value = node.label;  // 更新当前选中的节点标签
+
 };
 
 
@@ -2591,12 +2609,12 @@ const gySelection = ref('')
 const selectionChange = (selection, type) => {
   const ids = selection.map(item => {
 	  if(type === '印件资料'){
-		return type === '印件资料' ? item.UniqId: item.UniqId  
+		return type === '印件资料' ? item.UniqId: item.UniqId
 	  }
 	  if(type === '工艺资料'){
-	  return type === '工艺资料' ? item.UniqID: item.UniqID  
+	  return type === '工艺资料' ? item.UniqID: item.UniqID
 	  }
-    
+
   })
   console.log(ids)
   if (type === '印件资料') {
@@ -2610,7 +2628,7 @@ const selectionChange = (selection, type) => {
 const delgd_delclick = async () => {
   console.log(yjSelection.value)
   console.log(gySelection.value)
-	  
+
   if (yjSelection.value !== '') {
     try {
       const res1 = await PrintlDel({UniqId: yjSelection.value})
@@ -2925,7 +2943,7 @@ if(type2.value==='add'){
 const openSearchZhiModal = (code, idx) => {
   if (code.key==='Tab') {
     setTimeout(() => document.querySelector('.zhi').focus(), 50)
-    _getProductZzList() 
+    _getProductZzList()
     zzdhIndex.value = idx
   }
 }
@@ -3388,7 +3406,7 @@ const addgyenterDialog = async () =>{
 	 Object.keys(add_gyformData).forEach(key => {
 			add_gyformData[key] = '';
 		  });
-    
+
   	}else{
   		ElMessage({
   		  type: 'error',
@@ -3401,7 +3419,7 @@ const addgyenterDialog = async () =>{
 const GetInfo = async () => {
   const getProductData_data = await getProductData({product_code:_Gd_gdbh.value});
   yjtableData.splice(0, yjtableData.length, ...getProductData_data.data.yjData);
-  gytableData.splice(0, gytableData.length, ...getProductData_data.data.gyData);	
+  gytableData.splice(0, gytableData.length, ...getProductData_data.data.gyData);
 }
 //工艺新增取消
 const addgycloseDialog = () => {

+ 15 - 1
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -438,7 +438,7 @@
         <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
           <div class="JKWTree-tree" style="height: 200px">
             <h3>工单管理</h3>
-            <el-tree :data="treeData.data"  @node-click="handleNodeClick"></el-tree>
+            <el-tree :data="treeData.data" class="treecolor"   @node-click="handleNodeClick"></el-tree>
           </div>
         </layout-sider>
 
@@ -2998,6 +2998,20 @@ DataListdata();
 const tableData = reactive([])
 const _Gd_khdh = ref(null)
 const handleNodeClick = async (node) => {
+  // 取消所有节点的颜色
+  const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
+  allNodes.forEach(node => {
+    node.querySelector('.el-tree-node__label').style.color = '';
+  });
+  // 获取点击的节点
+  const clickedNodeId = node['$treeNodeId'];
+  const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
+  if (clickedNode) {
+    // 给当前点击的节点改变颜色
+    clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
+  }
+
+
   // if(node.id === '印刷工单' || node.id === '糊盒工单'){
   //   tableData.splice(0);
   //   return false;

File diff suppressed because it is too large
+ 384 - 345
src/view/yunyin/shengchanguanli/shebeiyunxing.vue


Some files were not shown because too many files changed in this diff