LAPTOP-16IUEB3P\Lenovo 2 лет назад
Родитель
Сommit
b5fe697af8
2 измененных файлов с 55 добавлено и 43 удалено
  1. 11 6
      src/views/produceOrder/components/progressBox.vue
  2. 44 37
      src/views/produceOrder/detail.vue

+ 11 - 6
src/views/produceOrder/components/progressBox.vue

@@ -12,7 +12,7 @@
             class="progress-box"
             :style="`backgroundImage:linear-gradient(to top, var(--color-primary), var(--color-primary) ${item.percent},#fff ${item.percent}, #fff);`"
           ></div>
-          <p class="num">{{ index + 1 }}</p>
+          <p class="num">{{ item.number }}</p>
         </li>
       </ul>
     </div>
@@ -22,10 +22,10 @@
 <script>
   export default {
     props: {
-      active: {
-        type: [Number, String],
-        default: 3
-      },
+      // active: {
+      //   type: [Number, String],
+      //   default: 3
+      // },
 		list:{
 			type: Array,
 			default: []
@@ -37,7 +37,8 @@
     },
     data () {
       return {
-        stepList: []
+        stepList: [],
+		active:-1
       };
     },
 	watch: {
@@ -48,6 +49,10 @@
 	        this.stepList.map((item,index)=>{
 				item.percent = ( item.number / this.total)*100  + '%'
 			})
+			const active = this.stepList.findIndex((item) => item.number === 0)
+			if(active==-1){
+				this.active = this.stepList.length-1
+			}
 	      }
 	    },
 	    immediate: true

+ 44 - 37
src/views/produceOrder/detail.vue

@@ -35,7 +35,9 @@
     </el-card>
 
     <el-card v-if="tabList.length">
-      <el-tabs v-model="activeName" type="card">
+      <el-tabs v-model="activeName" type="card"
+	     @tab-click="handleTabClick"
+	  >
 		  <el-tab-pane
 		    :label="item.taskTypeName"
 		    :name="item.taskTypeName"
@@ -65,85 +67,85 @@
             <ul v-if="activeName == '挤压成型'">
               <li>
                 <span class="label">累计合格品数量</span>
-                1500PCS
+                {{countMsg.standardTotalNum}}PCS
               </li>
               <li>
                 <span class="label">累计合格品重量</span>
-                1500PCS
+                {{countMsg.standardTotalWeight}}PCS
               </li>
               <li>
                 <span class="label">累计投料重量</span>
-                1500PCS
+                {{countMsg.feedMaterielWeight}}PCS
               </li>
             </ul>
             <ul v-else-if="['自然干燥', '升温干燥', '半加定长'].includes(activeName)">
               <li>
                 <span class="label">累计合格品数量</span>
-                1500PCS
+                {{countMsg.standardTotalNum}}PCS
               </li>
               <li>
                 <span class="label">累计合格品重量</span>
-                1500PCS
+                {{countMsg.standardTotalWeight}}PCS
               </li>
               <li>
                 <span class="label">累计投料产品重量</span>
-                1500PCS
+                {{countMsg.feedProductWeight}}PCS
               </li>
             </ul>
             <ul v-else-if="['备炉'].includes(activeName)">
               <li>
                 <span class="label">累计交接数量</span>
-                1500PCS
+                {{countMsg.joinTotalNum}}PCS
               </li>
               <li>
                 <span class="label">累计实际数量</span>
-                1500PCS
+                {{countMsg.joinTotalNum}}PCS
               </li>
             </ul>
             <ul v-else-if="['烧结', '质检', '深加工'].includes(activeName)">
               <li>
                 <span class="label">累计合格品数量</span>
-                1500PCS
+                {{countMsg.standardTotalNum}}PCS
               </li>
               <li>
                 <span class="label">累计合格品重量</span>
-                1500PCS
+                {{countMsg.standardTotalWeight}}PCS
               </li>
               <li>
                 <span class="label">累计投料数量</span>
-                1500PCS
+                {{countMsg.joinTotalNum}}PCS
               </li>
             </ul>
             <ul v-else-if="['包装'].includes(activeName)">
               <li>
                 <span class="label">累计交接数量</span>
-                1500PCS
+                {{countMsg.joinTotalNum}}PCS
               </li>
               <li>
                 <span class="label">累计实际数量</span>
-                1500PCS
+                {{countMsg.joinTotalNum}}PCS
               </li>
               <li>
                 <span class="label">累计包装数量</span>
-                1500PCS
+                {{countMsg.packTotalNum}}PCS
               </li>
               <li>
                 <span class="label">累计包装产品数量</span>
-                1500PCS
+                {{countMsg.packProductTotalNum}}PCS
               </li>
             </ul>
             <ul v-else-if="['缴库'].includes(activeName)">
               <li>
                 <span class="label">累计交接数量</span>
-                1500PCS
+                {{countMsg.joinTotalNum}}PCS
               </li>
               <li>
                 <span class="label">累计批次数量</span>
-                1500PCS
+                {{countMsg.inStoreBatchNum}}PCS
               </li>
               <li>
                 <span class="label">累计产品数量</span>
-                1500PCS
+                {{countMsg.joinTotalNum}}PCS
               </li>
             </ul>
 <!--            <el-link type="primary" v-if="activeName == 1" @click="openOther"
@@ -164,7 +166,7 @@
   import progressBox from './components/progressBox';
   import otherMission from './components/otherMission';
   import { getTaskListById } from '@/api/mainData/index.js';
-  import { reportPage , getInfoById } from '@/api/produceOrder/index.js';
+  import { reportPage , getInfoById , reportCount } from '@/api/produceOrder/index.js';
   export default {
     components: {
       otherMission,
@@ -740,7 +742,9 @@
 			5:'生产中',
 			6:'已完成',
 			7:'已延期'
-		}
+		},
+		countMsg: {},
+		chooseIndex:0
       };
     },
 	created () {
@@ -748,6 +752,16 @@
 	  this.getInfo(this.workOrderId)
 	},
     methods: {
+		handleTabClick(tab){
+			if(this.chooseIndex != tab.index ){
+				this.chooseIndex = tab.index
+				const chooseItem = this.tabList[this.chooseIndex]
+				this.activeName = chooseItem.taskTypeName || ''
+				this.taskCode = chooseItem.taskCode || ''
+				this.reload({workOrderId:this.workOrderId, taskCode:this.taskCode})
+				this.getReportCount()
+			}
+		},
 		 datasource({ page, limit,where }) {
 			return reportPage({ ...where, pageNum:page, size:limit });
 		 },
@@ -767,24 +781,17 @@
 			}
 			this.activeName = this.tabList[0]?.taskTypeName || ''
 			this.taskCode = this.tabList[0]?.taskCode || ''
+			this.chooseIndex = 0 
 			this.reload({workOrderId:this.workOrderId, taskCode:this.taskCode})
+			this.getReportCount()
+		},
+		async getReportCount () {
+		  const res = await reportCount({
+		    taskCode: this.taskCode,
+		    workOrderId: this.workOrderId
+		  });
+		  this.countMsg = res;
 		},
-		// async getTab (id) {
-		//   const res = await getTaskListById(id);
-		//   this.tabList = res;
-		//   this.activeName = res[0]?.taskTypeName || '';
-		//   this.getTabList(res[0].taskCode)
-		// },
-		// async getTabList(code){
-		// 	const data = {
-		// 		pageNum:1,
-		// 		size:10,
-		// 		taskCode:code,
-		// 		workOrderId:this.workOrderId
-		// 	}
-		// 	const res = await reportPage(data)
-		// 	console.log('res',res)
-		// },
 		  openOther () {
 			this.$refs.otherMissionRef.open();
 		  }