lxf 1 year ago
parent
commit
1cd55ab1e1

+ 10 - 1
src/api/shengde/group/spectaculars/dailyBoard.js

@@ -12,7 +12,7 @@ export function productionStorageBoard(data = {}) {
 // 每日看板-万里牛今日销售出库数据
 export function saleWarehouseBoard(params) {
   return request({
-    url: '/saas-subsidiary/saas/subsidiary/contract/saleWarehouseBoard',
+    url: '/saas-wanli/saas/wan/wanlidifference/saleWarehouseBoard',
     method: 'get',
     params: params,
   })
@@ -44,3 +44,12 @@ export function differenceBoard(params) {
     params: params,
   })
 }
+
+// MES&万里牛今日订单和BOM差异 (不含自建订单)
+export function getDifList(params) {
+  return request({
+    url: '/saas-wanli/saas/wan/wanlidifference/getDifList',
+    method: 'get',
+    params: params,
+  })
+}

+ 79 - 46
src/views/shengde/group/spectaculars/dailyBoard/index.vue

@@ -6,7 +6,7 @@
           <div class="cardTitle">MES今日生产出库数据</div>
           <div class="firstRowBoard">
             <span style="font-size: 16px !important">BOM出库总数(个)</span>
-            <span style="font-weight: 700; font-size: 20px !important">{{ TLData.count }}</span>
+            <span style="font-weight: 700; font-size: 20px !important">{{ TLData.count || 0 }}</span>
           </div>
           <el-table
             :data="TLData.list"
@@ -32,7 +32,7 @@
           <div class="cardTitle">MES&万里牛今日订单和BOM差异(不含自建订单)</div>
           <div class="firstRowBoard">
             <span style="font-size: 16px !important">差异订单总数(单)</span>
-            <span style="font-weight: 700; font-size: 20px !important">{{ TCData.count }}</span>
+            <span style="font-weight: 700; font-size: 20px !important">{{ TCData.count || 0 }}</span>
           </div>
           <el-table
             :data="TCData.list"
@@ -42,20 +42,20 @@
             height="30vh"
             style="margin-top: 20px"
           >
-            <el-table-column label="BOM编号" prop="colorCode" width="120" />
+            <el-table-column label="BOM编号" prop="bomColorCode" width="120" />
             <el-table-column label="MES" align="center" width="80">
               <template slot-scope="scope">
-                <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
+                <span v-if="scope.row.mesQuantity">{{ Number(scope.row.mesQuantity) }}</span>
                 <span v-else>0</span>
               </template>
             </el-table-column>
             <el-table-column label="万里牛" align="center" width="80">
               <template slot-scope="scope">
-                <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
+                <span v-if="scope.row.wlQuantity">{{ Number(scope.row.wlQuantity) }}</span>
                 <span v-else>0</span>
               </template>
             </el-table-column>
-            <el-table-column label="差异订单号" min-width="140" />
+            <el-table-column label="差异订单号" prop="codes" min-width="140" />
           </el-table>
         </el-card>
       </el-col>
@@ -64,7 +64,7 @@
           <div class="cardTitle">MES今日生产&出库差异</div>
           <div class="firstRowBoard">
             <span style="font-size: 16px !important">差异总数(个)</span>
-            <span style="font-weight: 700; font-size: 20px !important">{{ TRData.count }}</span>
+            <span style="font-weight: 700; font-size: 20px !important">{{ TRData.count || 0 }}</span>
           </div>
           <el-table
             :data="TRData.list"
@@ -101,17 +101,17 @@
               <div class="secondRowBoardTop">
                 <div>销售出库订单总数(单)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CLData.sumCount }}
+                  {{ CLData.sumCount || 0 }}
                 </div>
               </div>
               <div class="secondRowBoardBottom">
                 <div>BOM销售出库总数(个)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CLData.sumData.count }}
+                  {{ CLData.sumBomCount || 0 }}
                 </div>
               </div>
               <el-table
-                :data="CLData.sumData.list"
+                :data="CLData.sumBomList"
                 :cell-style="{ padding: '0' }"
                 :row-style="{ height: '50px' }"
                 header-row-class-name="tableHeader"
@@ -119,10 +119,10 @@
                 style="margin-top: 20px"
               >
                 <el-table-column label="序号" align="center" type="index" width="50" />
-                <el-table-column label="BOM编号" prop="colorCode" min-width="140" />
+                <el-table-column label="BOM编号" prop="bomColorCode" min-width="140" />
                 <el-table-column label="数量" align="center" width="80">
                   <template slot-scope="scope">
-                    <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
+                    <span v-if="scope.row.bomColorCount">{{ Number(scope.row.bomColorCount) }}</span>
                     <span v-else>0</span>
                   </template>
                 </el-table-column>
@@ -132,17 +132,17 @@
               <div class="secondRowBoardTop">
                 <div>佰卓销售出库订单总数(单)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CLData.bzCount }}
+                  {{ CLData.bzCount || 0 }}
                 </div>
               </div>
               <div class="secondRowBoardBottom">
                 <div>佰卓出库BOM总数(个)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CLData.bzData.count }}
+                  {{ CLData.sumBzBomCount || 0 }}
                 </div>
               </div>
               <el-table
-                :data="CLData.bzData.list"
+                :data="CLData.sumBzBomList"
                 :cell-style="{ padding: '0' }"
                 :row-style="{ height: '50px' }"
                 header-row-class-name="tableHeader"
@@ -150,10 +150,10 @@
                 style="margin-top: 20px"
               >
                 <el-table-column label="序号" align="center" type="index" width="50" />
-                <el-table-column label="BOM编号" prop="colorCode" min-width="140" />
+                <el-table-column label="BOM编号" prop="bomColorCode" min-width="140" />
                 <el-table-column label="数量" align="center" width="80">
                   <template slot-scope="scope">
-                    <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
+                    <span v-if="scope.row.bomColorCount">{{ Number(scope.row.bomColorCount) }}</span>
                     <span v-else>0</span>
                   </template>
                 </el-table-column>
@@ -163,17 +163,17 @@
               <div class="secondRowBoardTop">
                 <div>宝恒盛销售出库订单总数(单)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CLData.bhsCount }}
+                  {{ CLData.bhsCount || 0 }}
                 </div>
               </div>
               <div class="secondRowBoardBottom">
                 <div>宝恒盛出库BOM总数(个)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CLData.bhsData.count }}
+                  {{ CLData.sumBhsBomCount || 0 }}
                 </div>
               </div>
               <el-table
-                :data="CLData.bhsData.list"
+                :data="CLData.sumBhsBomList"
                 :cell-style="{ padding: '0' }"
                 :row-style="{ height: '50px' }"
                 header-row-class-name="tableHeader"
@@ -181,10 +181,10 @@
                 style="margin-top: 20px"
               >
                 <el-table-column label="序号" align="center" type="index" width="50" />
-                <el-table-column label="BOM编号" prop="colorCode" min-width="140" />
+                <el-table-column label="BOM编号" prop="bomColorCode" min-width="140" />
                 <el-table-column label="数量" align="center" width="80">
                   <template slot-scope="scope">
-                    <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
+                    <span v-if="scope.row.bomColorCount">{{ Number(scope.row.bomColorCount) }}</span>
                     <span v-else>0</span>
                   </template>
                 </el-table-column>
@@ -201,13 +201,13 @@
               <div class="secondRowBoardTop">
                 <div>生产订单总数(单)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CRData.sumCount }}
+                  {{ CRData.sumCount || 0 }}
                 </div>
               </div>
               <div class="secondRowBoardBottom">
                 <div>BOM生产总数(个)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CRData.sumBomCount }}
+                  {{ CRData.sumBomCount || 0 }}
                 </div>
               </div>
               <el-table
@@ -219,10 +219,10 @@
                 style="margin-top: 20px"
               >
                 <el-table-column label="序号" align="center" type="index" width="50" />
-                <el-table-column label="BOM编号" prop="colorCode" min-width="140" />
+                <el-table-column label="BOM编号" prop="bomColorCode" min-width="140" />
                 <el-table-column label="数量" align="center" width="80">
                   <template slot-scope="scope">
-                    <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
+                    <span v-if="scope.row.bomColorCount">{{ Number(scope.row.bomColorCount) }}</span>
                     <span v-else>0</span>
                   </template>
                 </el-table-column>
@@ -232,13 +232,13 @@
               <div class="secondRowBoardTop">
                 <div>佰卓生产订单总数(单)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CRData.bzCount }}
+                  {{ CRData.bzCount || 0 }}
                 </div>
               </div>
               <div class="secondRowBoardBottom">
                 <div>佰卓生产BOM总数(个)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CRData.sumBzBomCount }}
+                  {{ CRData.sumBzBomCount || 0 }}
                 </div>
               </div>
               <el-table
@@ -250,10 +250,10 @@
                 style="margin-top: 20px"
               >
                 <el-table-column label="序号" align="center" type="index" width="50" />
-                <el-table-column label="BOM编号" prop="colorCode" min-width="140" />
+                <el-table-column label="BOM编号" prop="bomColorCode" min-width="140" />
                 <el-table-column label="数量" align="center" width="80">
                   <template slot-scope="scope">
-                    <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
+                    <span v-if="scope.row.bomColorCount">{{ Number(scope.row.bomColorCount) }}</span>
                     <span v-else>0</span>
                   </template>
                 </el-table-column>
@@ -263,13 +263,13 @@
               <div class="secondRowBoardTop">
                 <div>宝恒盛生产订单总数(单)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CRData.bhsCount }}
+                  {{ CRData.bhsCount || 0 }}
                 </div>
               </div>
               <div class="secondRowBoardBottom">
                 <div>宝恒盛生产BOM总数(个)</div>
                 <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
-                  {{ CRData.sumBhsBomCount }}
+                  {{ CRData.sumBhsBomCount || 0 }}
                 </div>
               </div>
               <el-table
@@ -281,10 +281,10 @@
                 style="margin-top: 20px"
               >
                 <el-table-column label="序号" align="center" type="index" width="50" />
-                <el-table-column label="BOM编号" prop="colorCode" min-width="140" />
+                <el-table-column label="BOM编号" prop="bomColorCode" min-width="140" />
                 <el-table-column label="数量" align="center" width="80">
                   <template slot-scope="scope">
-                    <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
+                    <span v-if="scope.row.bomColorCount">{{ Number(scope.row.bomColorCount) }}</span>
                     <span v-else>0</span>
                   </template>
                 </el-table-column>
@@ -363,20 +363,14 @@ export default {
       },
       CLData: {
         sumCount: 0,
-        sumData: {
-          count: 0,
-          list: [],
-        },
+        sumBomCount: 0,
+        sumBomList: [],
         bzCount: 0,
-        bzData: {
-          count: 0,
-          list: [],
-        },
+        sumBzBomCount: 0,
+        sumBzBomList: [],
         bhsCount: 0,
-        bhsData: {
-          count: 0,
-          list: [],
-        },
+        sumBhsBomCount: 0,
+        sumBhsBomList: [],
       },
       CRData: {
         sumCount: 0,
@@ -413,6 +407,45 @@ export default {
           this.topLeft = false
         }
       )
+      this.topCenter = true
+      API.getDifList().then(
+        (res) => {
+          this.TCData = res.data.data
+          let num = 0
+          if (this.TCData.list && this.TCData.list.length > 0) {
+            for (let i = 0; i < this.TCData.list.length; i++) {
+              let codes = ''
+              if (this.TCData.list[i].code && this.TCData.list[i].code.length > 0) {
+                let list = this.TCData.list[i].code.reduce((acc, cur) => {
+                  if (acc[cur]) {
+                    acc[cur]++
+                  } else {
+                    acc[cur] = 1
+                  }
+                  return acc
+                }, {})
+                for (let text in list) {
+                  if (list[text] % 2 != 0) {
+                    num++
+                    if (codes) {
+                      codes = codes + ', ' + text
+                    } else {
+                      codes = text
+                    }
+                  }
+                }
+              }
+              this.TCData.list[i].codes = codes
+            }
+          }
+          this.TCData.count = num
+          this.topCenter = false
+        },
+        (err) => {
+          console.log('getDifList: ' + err)
+          this.topCenter = false
+        }
+      )
       this.topRight = true
       API.differenceBoard().then(
         (res) => {

+ 14 - 2
src/views/shengde/group/subscription/management/details/detailedList.vue

@@ -70,8 +70,7 @@
                 </el-table>
               </div>
               <span slot="reference" style="cursor: pointer" @click="clickOnTheWay(scope.row)">
-                <span style="color: #ff0000; font-weight: 700" v-if="scope.row.purchaseQuantity">{{ Number(scope.row.purchaseQuantity) }}</span>
-                <span style="color: #ff0000; font-weight: 700" v-else>0</span>
+                <span style="color: #ff0000; font-weight: 700">{{ getNum(scope.row) }}</span>
               </span>
             </el-popover>
           </template>
@@ -281,6 +280,19 @@ export default {
         return ''
       }
     },
+    getNum(item) {
+      let num = 0
+      if (item.sumPurchaseQuantity) {
+        num = Number(item.sumPurchaseQuantity)
+      }
+      if (item.putStockQuantity) {
+        num = Number(num) - Number(item.putStockQuantity)
+      }
+      if (item.returnedQuantity) {
+        num = Number(num) + Number(item.returnedQuantity)
+      }
+      return num
+    },
   },
 }
 </script>

+ 0 - 5
src/views/shengde/productionSystem/purchase/contract/contractList.vue

@@ -53,11 +53,6 @@
                   <span>¥{{ moneyFormat(scope.row.taxSumPrice, 3) }}</span>
                 </template>
               </el-table-column>
-              <!-- <el-table-column label="已入库数量" width="100" v-if="!status">
-                <template slot-scope="scope">
-                  <span v-if="scope.row.warehousingQuantity">{{ Number(scope.row.warehousingQuantity) }}</span>
-                </template>
-              </el-table-column> -->
               <el-table-column label="库存" width="90" v-if="status">
                 <template slot-scope="scope">
                   <span v-if="scope.row.inventoryQuantity">{{ Number(scope.row.inventoryQuantity) }}</span>

+ 13 - 18
src/views/shengde/productionSystem/purchase/contract/details/product.vue

@@ -38,25 +38,9 @@
         </el-table-column>
         <el-table-column label="已入库数量" width="100" v-if="!status">
           <template slot-scope="scope">
-            <span v-if="scope.row.warehousingQuantity">{{ Number(scope.row.warehousingQuantity) }}</span>
+            <span>{{ getNum(scope.row) }}</span>
           </template>
         </el-table-column>
-        <!-- <el-table-column label="库存" width="90" v-if="status">
-          <template slot-scope="scope">
-            <span v-if="scope.row.inventoryQuantity">{{ Number(scope.row.inventoryQuantity) }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="近30天消耗量" width="90" v-if="status">
-          <template slot-scope="scope">
-            <span v-if="scope.row.consumeQuantity">{{ Number(scope.row.consumeQuantity) }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="近期采购时间" prop="recentTime" width="140" v-if="status" />
-        <el-table-column label="近期采购量" width="90" v-if="status">
-          <template slot-scope="scope">
-            <span v-if="scope.row.recentQuantity">{{ Number(scope.row.recentQuantity) }}</span>
-          </template>
-        </el-table-column> -->
       </el-table>
     </el-form>
   </div>
@@ -75,7 +59,18 @@ export default {
   },
   created() {},
   mounted() {},
-  methods: {},
+  methods: {
+    getNum(item) {
+      let num = 0
+      if (item.warehousingQuantity) {
+        num = Number(item.warehousingQuantity)
+        if (item.returnedQuantity) {
+          num = Number(num) - Number(item.returnedQuantity)
+        }
+      }
+      return num
+    },
+  },
 }
 </script>