quwangxin 2 years ago
parent
commit
664b25130f
3 changed files with 47 additions and 31 deletions
  1. 1 0
      src/main.js
  2. 31 29
      src/views/produceOrder/index.vue
  3. 15 2
      src/views/produceOrder/report.vue

+ 1 - 0
src/main.js

@@ -60,6 +60,7 @@ export async function bootstrap () {
 
 
 export async function mount (props) {
 export async function mount (props) {
   console.log('[vue] props from main framework', props);
   console.log('[vue] props from main framework', props);
+  Vue.prototype.$portalStore = props.store;
 
 
   initParentStore(props.store);
   initParentStore(props.store);
   props.onGlobalStateChange((state, prev) => {
   props.onGlobalStateChange((state, prev) => {

+ 31 - 29
src/views/produceOrder/index.vue

@@ -118,10 +118,10 @@
         isBindPlan: false,
         isBindPlan: false,
         statusOpt: {
         statusOpt: {
           first: [
           first: [
-            { label: '所有状态', value: '5,4,7' },
+            { label: '所有状态', value: '5,4' },
             { label: '待生产', value: '4' },
             { label: '待生产', value: '4' },
-            { label: '生产中', value: '5' },
-            { label: '已延期', value: '7' }
+            { label: '生产中', value: '5' }
+            // { label: '已延期', value: '7' }
           ],
           ],
           second: [{ label: '已完成', value: '6' }]
           second: [{ label: '已完成', value: '6' }]
         },
         },
@@ -184,12 +184,12 @@
             align: 'center',
             align: 'center',
             minWidth: 110
             minWidth: 110
           },
           },
-		 {
-			  prop: 'originalCode',
-			  label: '原始工单号',
-			  align: 'center',
-			  minWidth: 110
-		  },
+          {
+            prop: 'originalCode',
+            label: '原始工单号',
+            align: 'center',
+            minWidth: 110
+          },
           {
           {
             prop: 'productionPlanCode',
             prop: 'productionPlanCode',
             label: '计划编号',
             label: '计划编号',
@@ -199,12 +199,10 @@
             prop: 'planType',
             prop: 'planType',
             label: '计划类型',
             label: '计划类型',
             align: 'center',
             align: 'center',
-			formatter: (row) => {
-			  const obj = this.planType.find(
-			    (i) => i.value == row.planType
-			  );
-			  return obj && obj.label;
-			}
+            formatter: (row) => {
+              const obj = this.planType.find((i) => i.value == row.planType);
+              return obj && obj.label;
+            }
           },
           },
           {
           {
             prop: 'produceVersionName',
             prop: 'produceVersionName',
@@ -366,19 +364,23 @@
           this.selection.map((item) => {
           this.selection.map((item) => {
             ids.push(item.id);
             ids.push(item.id);
           });
           });
-		  const h = this.$createElement;
-           this.$msgbox({
-			  title: '提醒',
-			  message: h('p', null, [
-				h('span', null, '是否要完结 '),
-				h('span', { style: 'color: #70B603' }, `${this.selection.length}`),
-				h('span', null, ' 条工单?'),
-			  ]),
-			  showCancelButton: true,
-			  confirmButtonText: '确认',
-			  cancelButtonText: '取消',
-			  type: 'warning'
-			})
+          const h = this.$createElement;
+          this.$msgbox({
+            title: '提醒',
+            message: h('p', null, [
+              h('span', null, '是否要完结 '),
+              h(
+                'span',
+                { style: 'color: #70B603' },
+                `${this.selection.length}`
+              ),
+              h('span', null, ' 条工单?')
+            ]),
+            showCancelButton: true,
+            confirmButtonText: '确认',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
             .then(() => {
             .then(() => {
               batchCompletion(ids).then((res) => {
               batchCompletion(ids).then((res) => {
                 this.$message.success('成功');
                 this.$message.success('成功');
@@ -420,7 +422,7 @@
           path: '/produceOrder/detail',
           path: '/produceOrder/detail',
           query: {
           query: {
             id: row.id,
             id: row.id,
-			produceVersionId: row.produceVersionId
+            produceVersionId: row.produceVersionId
           }
           }
         });
         });
       },
       },

+ 15 - 2
src/views/produceOrder/report.vue

@@ -119,7 +119,7 @@
       <components
       <components
         v-if="tabList.length"
         v-if="tabList.length"
         ref="reportRef"
         ref="reportRef"
-        :is="componentsList[tabList[activeName].name] || 'Common'"
+        :is="componentName"
         :key="activeName"
         :key="activeName"
         :infoData="infoData"
         :infoData="infoData"
         :taskInfo="{
         :taskInfo="{
@@ -180,7 +180,7 @@
           挤压成型: 'Extrusion',
           挤压成型: 'Extrusion',
           自然干燥: 'Drying',
           自然干燥: 'Drying',
           升温干燥: 'Heating',
           升温干燥: 'Heating',
-          半加定长: 'HalfAdded',
+          半加: 'HalfAdded',
           备炉: 'Furnace',
           备炉: 'Furnace',
           烧结: 'Common', //'Sinter',
           烧结: 'Common', //'Sinter',
           深加工: 'Common',
           深加工: 'Common',
@@ -189,6 +189,19 @@
         }
         }
       };
       };
     },
     },
+    computed: {
+      componentName () {
+        const { name } = this.tabList[this.activeName];
+
+        if (name.includes('半加')) {
+          return 'HalfAdded';
+        }
+
+        return (
+          this.componentsList[this.tabList[this.activeName].name] || 'Common'
+        );
+      }
+    },
     created () {
     created () {
       this.getDetail(this.$route.query.id);
       this.getDetail(this.$route.query.id);
     },
     },