Explorar el Código

提交车间的派工单合计

Lijy hace 1 año
padre
commit
aa897acefd

+ 40 - 6
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/product/list.vue

@@ -232,12 +232,12 @@
                     </el-table-column>
                     <el-table-column prop="workingTime" label="单件工时(分)"  width="140">
                         <template slot-scope="scope">
-                            <el-input v-model="scope.row.workingTime"   clearable maxlength="11" placeholder="请输入"></el-input>
+                            <el-input v-model.number="scope.row.workingTime"   clearable maxlength="11" placeholder="请输入"></el-input>
                         </template>
                     </el-table-column>
                     <el-table-column prop="unitPrice" label="单件工价(元)" width="140">
                         <template slot-scope="scope">
-                            <el-input v-model="scope.row.unitPrice"   clearable maxlength="9"  placeholder="请输入"></el-input>
+                            <el-input v-model.number="scope.row.unitPrice"   clearable maxlength="9"  placeholder="请输入"></el-input>
                         </template>
                     </el-table-column>
                     <el-table-column label="质检类型" width="150">
@@ -247,7 +247,6 @@
                                     :value="item.value">
                                 </el-option>
                             </el-select>
-
                         </template>
                     </el-table-column>
                     <el-table-column label="操作" width="100" fixed="right">
@@ -256,7 +255,15 @@
                         </template>
                     </el-table-column>
                 </el-table>
-                <i class="el-icon-plus" @click="addProcedure()"></i>
+
+                <div class="workshopTotal">
+                    <div class="workshopTotalHeji">
+                        <i class="el-icon-plus" @click="addProcedure()"></i>
+                        <span>合计</span>
+                    </div>
+                    <div class="workshopTotalText">{{ pieceHourTotal }}</div>
+                    <div>{{ priceSingleTotal }}</div>
+                </div>
 
             </div>
             <!--此处是录入物料的模块-->
@@ -925,7 +932,18 @@ export default {
             this.$refs.productTbl.doLayout();
         })
     },
-
+    computed: {
+        pieceHourTotal: function () {
+            return this.procedureLit.reduce((total, item) => {
+                return +total + +item.workingTime
+            }, 0)
+        },
+        priceSingleTotal: function () {
+            return this.procedureLit.reduce((total, item) => {
+                return +total + +item.unitPrice
+            }, 0)
+        },
+    },
     methods: {
         uploadFile(params) {
             let str = params.file.name.split(".");
@@ -3653,7 +3671,23 @@ export default {
     text-overflow: ellipsis;
 }
 
-.dialogSwitch {}
+.workshopTotal {
+    display: flex;
+    align-items: center;
+    height: 40px;
+    font-size: 18px;
+    .workshopTotalHeji {
+        width: 340px;
+        margin-right: 20px;
+        display: flex;
+        justify-content: space-between;
+    }
+    .workshopTotalText {
+        width: 120px;
+        margin-right: 30px;
+        padding-left: 10px;
+    }
+}
 
 // 111
 </style>