Bläddra i källkod

前端更新 sdy

zhongtianhaoyuan 3 år sedan
förälder
incheckning
dc99a6b8af

+ 336 - 0
public/static/weightCheck.html

@@ -0,0 +1,336 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+    <title></title>
+    <style>
+      table,
+      table tr th,
+      table tr td {
+        border: 2px solid #333333;
+        padding: 5px 0;
+      }
+
+      #app {
+        height: 98vh;
+        position: relative;
+      }
+
+      .content {
+        width: 1000px;
+        height: 583px;
+        margin: auto;
+        position: absolute;
+        top: 0;
+        bottom: 0;
+        left: 0;
+        right: 0;
+      }
+
+      table {
+        width: 100%;
+        text-align: center;
+        border-collapse: collapse;
+        border: 3px solid #333333;
+      }
+
+      .col-bgc {
+        background: #f6f7fb;
+      }
+
+      .bottom-row1 {
+        display: flex;
+        /* justify-content: space-between; */
+        margin: 20px 0;
+      }
+
+      .bottom-row2 {
+        display: flex;
+        margin: 10px 0;
+      }
+
+      img {
+        width: 41px;
+        height: 41px;
+        margin-right: 118px;
+      }
+
+      .config {
+        margin-top: 20px;
+        margin-right: 240px;
+      }
+      .autograph{
+    margin-top: 20px;
+     }
+      .bottom-row3 {
+        margin: 10px 0;
+      }
+
+      .title {
+        text-align: center;
+        font-size: 24px;
+      }
+
+      .number {
+        text-align: right;
+        margin-bottom: 10px;
+      }
+
+      .small-row {
+        display: flex;
+      }
+
+      .small-content {
+        width: 400px;
+        margin: 0 auto;
+        border: 1px solid #ccc;
+        padding: 20px 20px 160px 20px;
+        position: absolute;
+        top: 0;
+        bottom: 0;
+        left: 0;
+        right: 0;
+        margin: auto;
+        height: 650px;
+      }
+
+      .small-title {
+        text-align: center;
+        font-size: 18px;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+      }
+
+      .small-row {
+        display: flex;
+        justify-content: space-between;
+        margin: 10px;
+      }
+
+      .small-img {
+        margin-right: 0;
+      }
+      .sign{
+        margin-right: 100px;
+      }
+    </style>
+  </head>
+  <body>
+    <div id="app">
+      <div class="content" v-if="bigContent">
+        <div class="title">粮食检斤单</div>
+        <div class="number">{{tableData.number}}</div>
+        <table class="table">
+          <tr class="row">
+            <td class="col col-bgc">客户姓名</td>
+            <td class="col" colspan="2">{{tableData.customer}}</td>
+            <td class="col col-bgc">客户电话</td>
+            <td class="col" >{{tableData.customerPhone}}</td>
+            <td class="col col-bgc">车牌号</td>
+            <td class="col" colspan="2">{{tableData.carNumber}}</td>
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc">收货单位</td>
+            <td class="col" colspan="2">{{tableData.compName}}</td>
+            <td class="col col-bgc">联系人</td>
+            <td class="col" >{{tableData.person}}</td>
+            <td class="col col-bgc">联系电话</td>
+            <td class="col" colspan="2">{{tableData.personPhone}}</td>
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc">货名</td>
+            <td class="col">{{tableData.goodsName}}</td>
+            <td class="col col-bgc">类型</td>
+            <td class="col">{{tableData.type}}</td>
+            <td class="col col-bgc">容量(克/升)</td>
+            <td class="col">{{tableData.qualityInspectionManagement.bulkDensity}}</td>
+            <td class="col col-bgc">不完整粒(%)</td>
+            <td class="col">{{tableData.qualityInspectionManagement.imperfectGrain}}</td>
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc">等级</td>
+            <td class="col">{{tableData.qualityInspectionManagement.grade}}</td>
+            <td class="col col-bgc">水分(%)</td>
+            <td class="col">{{tableData.qualityInspectionManagement.waterContent}}</td>
+            <td class="col col-bgc">热损伤(%)</td>
+            <td class="col">{{tableData.qualityInspectionManagement.jiaorenli}}</td>
+            <td class="col col-bgc" colspan="2">质检{{tableData.qualityInspectionManagement.suqualityTestingDate}}</td>
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc">杂质(%)</td>
+            <td class="col">{{tableData.qualityInspectionManagement.impurity}}</td>
+            <td class="col col-bgc">霉变粒(%)</td>
+            <td class="col">{{tableData.qualityInspectionManagement.mildewGrain}}</td>
+            <td class="col col-bgc">扣杂(公斤)</td>
+            <td class="col">{{tableData.buckleMiscellaneous}}</td>
+            <td class="col col-bgc">净重(公斤)</td>
+            <td class="col">{{tableData.netWeight}}</td>
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc">毛重(公斤)</td>
+            <td class="col">{{tableData.grossWeight}}</td>
+            <td class="col col-bgc">皮重(公斤)</td>
+            <td class="col">{{tableData.tare}}</td>
+            <td class="col " colspan="4"></td>
+           
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc" colspan="2">毛重检斤时间</td>
+            <td class="col" colspan="2">{{tableData.grossDate}}</td>
+            <td class="col col-bgc" colspan="2"> 皮重检斤时间</td>
+            <td class="col" colspan="2">{{tableData.tareDate}}</td>
+          </tr>
+        </table>
+        <div class="bottom">
+          <div class="bottom-row1">
+            <div>毛检:{{tableData.secretaryWeigher}}</div>
+            <div style="margin-left:60px">皮检:{{tableData.skinInspector}}</div>
+            <!-- <div>{{tableData.qualityDate}}</div> -->
+          </div>
+          <div class="bottom-row2">
+            <div class="left">
+              <img src="../img/add.png" alt="">
+            </div>
+            <div class="config">收货单位签名或盖章:</div>
+            <div class="autograph">客户签名:</div>
+          </div>
+          <div class="bottom-row3">扫一扫</div>
+        </div>
+      </div>
+      <div class="small-content" v-if="smallContent">
+        <div class="small-title">
+          <div>粮食检斤单</div>
+          <img class="small-img" src="../img/add.png" alt="">
+        </div>
+        <div class="small-row">
+          <div>编号</div>
+          <div>{{tableData.number}}</div>
+        </div>
+        <div class="small-row">
+          <div>客户姓名</div>
+          <div>{{tableData.customer}}</div>
+        </div>
+        <div class="small-row">
+          <div>客户电话</div>
+          <div>{{tableData.customerPhone}}</div>
+        </div>
+        <div class="small-row">
+          <div>车牌号</div>
+          <div>{{tableData.carNumber}}</div>
+        </div>
+        <div class="small-row">
+          <div>收货单位</div>
+          <div>{{tableData.compName}}</div>
+        </div>
+        <div class="small-row">
+          <div>联系人</div>
+          <div>{{tableData.person}}</div>
+        </div>
+        <div class="small-row">
+          <div>联系电话</div>
+          <div>{{tableData.personPhone}}</div>
+        </div>
+        <div class="small-row">
+          <div>货名</div>
+          <div>{{tableData.goodsName}}</div>
+        </div>
+        <div class="small-row">
+          <div>类型</div>
+          <div>{{tableData.type}}</div>
+        </div>
+        <div class="small-row">
+            <div>皮重(公斤)</div>
+            <div>{{tableData.tare}}</div>
+          </div>
+          <div class="small-row">
+            <div>皮检时间</div>
+            <div>{{tableData.tareDate}}</div>
+          </div>
+          <div class="small-row">
+            <div>毛重(公斤)</div>
+            <div>{{tableData.grossWeight}}</div>
+          </div>
+          <div class="small-row">
+            <div>毛检时间</div>
+            <div>{{tableData.grossDate}}</div>
+          </div>
+        
+        <div class="small-row">
+          <div>扣杂(公斤)</div>
+          <div>{{tableData.buckleMiscellaneous}}</div>
+        </div>
+        <div class="small-row">
+          <div>净重(公斤)</div>
+          <div>{{tableData.netWeight}}</div>
+        </div>
+        <div class="small-row">
+          <div>收货单位签名或盖章:</div>
+          <div class="sign">客户签名:</div>
+        </div>
+      </div>
+    </div>
+  </body>
+  <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
+  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
+  <script type="text/javascript">
+    new Vue({
+      el: '#app',
+      data: {
+        tableData: {},
+        name: "",
+        bigContent: false,
+        smallContent: false
+      },
+      computed: {},
+      methods: {
+        tableRowClassName({
+          row,
+          rowIndex
+        }) {
+          if (rowIndex === 1) {
+            return 'warning-row';
+          } else if (rowIndex === 3) {
+            return 'success-row';
+          }
+          return '';
+        },
+        getQueryVariable(variable) {
+          var query = window.location.search.substring(1);
+          var vars = query.split("&");
+          for (var i = 0; i < vars.length; i++) {
+            var pair = vars[i].split("=");
+            if (pair[0] == variable) {
+              return pair[1];
+            }
+          }
+          return (false);
+        },
+        printSmall() {},
+        printBig() {},
+      },
+      mounted() {
+        debugger
+        let _data = decodeURIComponent(this.getQueryVariable("dialogData"))
+        let _type = decodeURIComponent(this.getQueryVariable("type"))
+        if (_type == 2) {
+          this.bigContent = true
+          this.smallContent = false
+        } else {
+          this.smallContent = true
+          this.bigContent = false
+        }
+        console.log(_data)
+        this.tableData = JSON.parse(_data)
+        console.log(this.tableData)
+        window.print()
+        window.onafterprint = function(event) {
+          window.history.back(-1)
+        };
+      },
+      watch: {}
+    })
+  </script>
+
+</html>

+ 7 - 0
src/api/V2/houseSelfCollect/index.js

@@ -53,5 +53,12 @@ export const API_GET_INSPECT_GETAMOUNT = '/paymentManagement/cumulant'
 
 //识别身份证
 export const API_GET_CUSTOMER_GETIDENTITY = '/driverViewInfo/personShibie'
+//识别银行卡
+export const API_GET_CUSTOMER_GETBANK = '/driverViewInfo/bankShibie'
+//查询货名有未结算状态
+export const API_GET_INSPECT_GETCOUNT= '/qualityInspectionManagement/api/settledCount'
+//检斤打印查看
+export const API_GET_WEIGHTCHECK_GETPRINT= '/weighingManagement/api/getWeighingManagement'
+
 
 

+ 11 - 3
src/model/houseSelfCollect/index.js

@@ -28,8 +28,10 @@ import {
   API_POST_WEIGHTCHECK_GROSSWEIGHT,
   API_POST_WEIGHTCHECK_TARE,
   API_GET_INSPECT_GETAMOUNT,
-  API_GET_CUSTOMER_GETIDENTITY
-
+  API_GET_CUSTOMER_GETIDENTITY,
+  API_GET_CUSTOMER_GETBANK,
+  API_GET_INSPECT_GETCOUNT,
+  API_GET_WEIGHTCHECK_GETPRINT
 } from '@/api/V2/houseSelfCollect'
 //客户管理列表
 export const getCustomerManage = appRx.get(API_GET_CUSTOMER_MANAGE, errorCatcher, errorHandle, filter)
@@ -86,4 +88,10 @@ export const grossWeight = appRx.post(API_POST_WEIGHTCHECK_GROSSWEIGHT, errorCat
 export const getamount = appRx.get(API_GET_INSPECT_GETAMOUNT, errorCatcher, errorHandle, filter)
 
 //身份证识别
-export const getIdentity  = appRx.get(API_GET_CUSTOMER_GETIDENTITY, errorCatcher, errorHandle, filter)
+export const getIdentity = appRx.get(API_GET_CUSTOMER_GETIDENTITY, errorCatcher, errorHandle, filter)
+//银行卡识别
+export const getBank = appRx.get(API_GET_CUSTOMER_GETBANK, errorCatcher, errorHandle, filter)
+//查询货名有未结算状态
+export const getCount = appRx.get(API_GET_INSPECT_GETCOUNT, errorCatcher, errorHandle, filter)
+//检斤打印查看
+export const getPrint = appRx.get(API_GET_WEIGHTCHECK_GETPRINT, errorCatcher, errorHandle, filter)

+ 0 - 0
src/views/houseSelfCollect/component/weightCheck.vue


+ 29 - 22
src/views/houseSelfCollect/customerManagementAdd.vue

@@ -308,6 +308,7 @@ import {
   getCustomerLook,
   CustomerEdit,
   getIdentity,
+  getBank
 } from '@/model/houseSelfCollect/index'
 
 export default {
@@ -322,7 +323,6 @@ export default {
         customerNumberCard:"",
         bankCard:"",
         bankDeposit:"",
-
       },
       disabledFlag: true,
       disabled: false,
@@ -371,7 +371,6 @@ export default {
       this.trader = '编辑'
       this.getList(id)
     }
-    console.log(this.switchType)
   },
   methods: {
     handleRemove(file, index) {
@@ -387,14 +386,12 @@ export default {
             this.identity.splice(i, 1, '')
           }
         }
-        console.log(this.identity)
       } else if (this.switchType == 1) {
         for (let i = 0; i < this.identity.length; i++) {
           if (file.response.url == this.identity[i]) {
             this.identity.splice(i, 1, '')
           }
         }
-        console.log(this.identity)
       }
     },
     handleRemove1(file, index) {
@@ -416,8 +413,6 @@ export default {
           }
         }
       }
-
-      console.log(this.bank)
     },
     handlePictureCardPreview(file) {
       this.dialogImageUrl = file.url
@@ -475,7 +470,6 @@ export default {
           }
           if(response.recPersonNo != ""){
              this.customerList.customerNumberCard = response.recPersonNo
-
           }
         })
     },
@@ -493,15 +487,34 @@ export default {
 
           }
         })
-
     },
     bankSuccess1(e) {
       this.bankUps = 'bankUp'
       this.bank[0] = e.url
+        getBank({bankImg:e.url})
+        .toPromise()
+        .then((response) => {
+          if(response.bankNo  ){
+             this.customerList.bankCard = response.bankNo
+          }
+          if(response.bankName ){
+             this.customerList.bankDeposit = response.bankName
+          }
+        })
     },
     bankSuccess2(e) {
       this.bankLows = 'bankLow'
       this.bank[1] = e.url
+       getBank({bankImg:e.url})
+        .toPromise()
+        .then((response) => {
+          if(response.bankNo  ){
+             this.customerList.bankCard = response.bankNo
+          }
+          if(response.bankName ){
+             this.customerList.bankDeposit = response.bankName
+          }
+        })
     },
     commit() {
       this.customerList.compId = sessionStorage.getItem('ws-pf_compId')
@@ -516,22 +529,17 @@ export default {
           type: 'warning',
         })
           .then(() => {
-            // this.customerList.compId = sessionStorage.getItem('ws-pf_compId')
-            // this.customerList.cardAddressUrl = this.identity.toString()
-            // this.customerList.payeeAddressUrl = this.bank.toString()
-            // this.customerList.customerTypeFlag = 1
-            // this.customerList.customerType = '个人'
             customerAdd(this.customerList)
               .toPromise()
               .then((response) => {
-                this.customerList.id = response
-                customerIdentity(this.customerList)
-                  .toPromise()
-                  .then((response) => {
-                    console.log(response.code)
-                    this.$message.success('添加成功')
-                    this.$router.push({ path: 'customerManagement' })
-                  })
+                // this.customerList.id = response
+                // customerIdentity(this.customerList)
+                //   .toPromise()
+                //   .then((response) => {
+                //     this.$message.success('添加成功')
+                //     this.$router.push({ path: 'customerManagement' })
+                //   })
+                this.$router.go(-1)
               })
           })
           .catch(() => {
@@ -557,7 +565,6 @@ export default {
       }
     },
     getList(ids) {
-      authenticationStatusKey==7
       getCustomerLook({ id: ids,authenticationStatusKey: 7 })
         .toPromise()
         .then((response) => {

+ 240 - 30
src/views/houseSelfCollect/inspectInfo.vue

@@ -22,6 +22,15 @@
         <div style="width: 50%; margin: 0 auto">
           <div class="title">基本信息</div>
           <ws-info-table>
+            <ws-form-item label="仓库" span="1" prop="warehouseName">
+              <ws-input
+                v-model="warehouseName"
+                placeholder="请输入仓库"
+                maxlength="100"
+                disabled
+                size="small"
+              />
+            </ws-form-item>
             <ws-form-item label="编号" span="1" prop="qualityNo">
               <ws-input
                 v-model="inspect.qualityNo"
@@ -48,10 +57,11 @@
             </ws-form-item>
             <ws-form-item label="客户" span="1" prop="customerName">
               <ws-select
+                v-model="inspect.customerName"
                 placeholder=""
                 class="typeselect"
                 @change="customerChange"
-                :disabled="disabled"
+                :disabled="disabled1"
               >
                 <ws-option
                   v-for="item in customerList"
@@ -84,12 +94,12 @@
                 v-model="inspect.goodsName"
                 placeholder=""
                 class="typeselect"
-                :disabled="disabled"
+                :disabled="disabled1"
                 @change="waterContentChange"
               >
                 <ws-option
-                  v-for="item in goodnameList"
-                  :key="item.goodsNameKey"
+                  v-for="item in goodNameList"
+                  :key="item.goodsName"
                   :label="item.goodsName"
                   :value="item.goodsName"
                 />
@@ -250,6 +260,7 @@ import {
   getinspectLookGoods,
   getinspectEdit,
   getamount,
+  getCount
 } from '@/model/houseSelfCollect/index'
 import { packList } from '@/model/contarct/index'
 import houseSelfCollectPrint from './houseSelfCollectPrint.vue'
@@ -263,11 +274,13 @@ export default {
       // warehouseList: {},
       inspect: {
         tidalGrainPrice: 0,
+        buckleWeightRatio: 0,
       },
       disabled: false,
+      disabled1: false,
       types: '1',
       information: '添加',
-      goodnameList: [],
+      goodNameList: [],
       gradeList: [],
       customerList: [],
       getbinNumberList: [],
@@ -277,8 +290,8 @@ export default {
       count: 0,
       cangNo: '',
       typeList: ['干粮', '潮粮'],
-      purchasePriceList:[],
-      id:"",
+      purchasePriceList: [],
+      id: '',
     }
   },
   activated() {
@@ -291,9 +304,11 @@ export default {
     this.id = this.$route.query.id
     if (this.types == 2) {
       this.disabled = true
+      this.disabled1 = true
       this.information = '查看'
     } else if (this.types == 3) {
       this.disabled = false
+      this.disabled1 = true
       this.information = '编辑'
     }
     this.calculation()
@@ -320,6 +335,210 @@ export default {
       // + this.verifyinit()
     },
     print() {
+      if (!this.inspect.qualityNo) {
+        this.$message({
+          message: '编号不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.binNumber) {
+        this.$message({
+          message: '仓位不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.customerName) {
+        this.$message({
+          message: '客户不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.storageTagNo) {
+        this.$message({
+          message: '囤位号不能为空',
+          type: 'warning',
+        })
+        return
+      }
+
+      if (this.inspect.storageTagNo.length > 10) {
+        this.$message({
+          message: '囤位号不超过10个字符',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.carNumber) {
+        this.$message({
+          message: '车牌号不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (this.inspect.carNumber.length > 7) {
+        this.$message({
+          message: '车牌号输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.goodsName) {
+        this.$message({
+          message: '货名不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.inspect.buckleWeightRatio < 0 ||
+        this.inspect.buckleWeightRatio > 2
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
+        String(this.inspect.buckleWeightRatio).length -
+          (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
+          2
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.type) {
+        this.$message({
+          message: '类型不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.type) {
+        this.$message({
+          message: '类型不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.natureOfGrainPurchase) {
+        this.$message({
+          message: '购粮性质不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.grade) {
+        this.$message({
+          message: '等级不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.impurity) {
+        this.$message({
+          message: '杂质不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.waterContent) {
+        this.$message({
+          message: '水分不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.mildewGrain) {
+        this.$message({
+          message: '霉变粒不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.bulkDensity) {
+        this.$message({
+          message: '容重不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.jiaorenli) {
+        this.$message({
+          message: '热损伤不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.imperfectGrain) {
+        this.$message({
+          message: '不完整粒不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      //查看当前用户对应货名有未结算状态的送货
+      let count = 0
+      getCount({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        customerName: this.inspect.customerName,
+        goodsName: this.inspect.goodsName,
+      })  .toPromise()
+        .then((response) => {
+             count = response
+        })
+      //  客户下拉校验
+      getamount({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        customerName: this.inspect.customerName,
+        goodsName: this.inspect.goodsName,
+      })
+        .toPromise()
+        .then((response) => {
+          for (let i = 0; i < this.purchasePriceList.length; i++) {
+            if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
+              console.log(this.purchasePriceList[i].saleLimit - response)
+              if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
+                // this.$confirm(
+                //   '当前客户已累计销售我司' +
+                //     this.inspect.goodsName +
+                //     response +
+                //     '吨,最高可售' +
+                //     this.purchasePriceList[i].saleLimit +
+                //     '吨。',
+                //   '提示',
+                //   {
+                //     cancelButtonText: '取消',
+                //     type: 'warning',
+                //   }
+                // )
+                //   .then(() => {})
+                //   .catch(() => {
+                //     return false
+                //   })
+                  this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
+                        '提示',
+                        {
+                          confirmButtonText: '确定',
+                          callback: (action) => {
+                            // this.$message({
+                            //   type: 'info',
+                            //   message: `累计售粮已超出上限`,
+                            // })
+                          },
+                        }
+                      )
+              }
+            }
+          }
+        })
       this.inspect.warehouseName = this.warehouseName
       this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
       this.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
@@ -334,7 +553,7 @@ export default {
               .toPromise()
               .then((response) => {
                 this.$message.success('保存成功')
-                this.$router.push({ path: 'paymentManagement' })
+                this.$router.go(-1)
               })
           })
           .catch(() => {
@@ -359,7 +578,8 @@ export default {
                 // window.print()
                 // document.body.innerHTML = oldstr
                 // window.location.reload()
-                this.$router.push({ path: 'paymentManagement' })
+                // this.$router.push({ path: 'paymentManagement' })
+                this.$router.go(-1)
               })
           })
           .catch(() => {
@@ -374,31 +594,22 @@ export default {
       let customers = e.split('(')
       this.inspect.customerName = customers[0]
       this.inspect.customerPhone = customers[1].split(')')[0]
-      //客户下拉校验
-      // getamount({
-      //   compId: sessionStorage.getItem('ws-pf_compId'),
-      //   customerName: this.inspect.customerPhone,
-      //   goodsName: this.inspect.goodsName,
-      // })
-      //   .toPromise()
-      //   .then((response) => {
-      //     console.log(response)
-      //   })
     },
 
     waterContentChange() {
-      if(this.inspect.goodsName){
-        for(var i=0;i<this.purchasePriceList.length;i++){
-          if(this.purchasePriceList[i].goodsName == this.inspect.goodsName){
-            this.inspect.buckleWeightRatio = this.purchasePriceList[i].deductWeight
+      if (this.inspect.goodsName) {
+        for (var i = 0; i < this.purchasePriceList.length; i++) {
+          if (this.purchasePriceList[i].goodsName == this.inspect.goodsName) {
+            this.inspect.buckleWeightRatio =
+              this.purchasePriceList[i].deductWeight
           }
         }
       }
       //潮粮单价改变事件
       if (
-        this.inspect.goodsName  &&
-        this.inspect.waterContent  &&
-        this.inspect.grade 
+        this.inspect.goodsName &&
+        this.inspect.waterContent &&
+        this.inspect.grade
       ) {
         getinspectLookUnitPrice({
           warehouseId: this.cangid,
@@ -413,14 +624,14 @@ export default {
           })
       }
     },
-   
+
     getList(ids) {
       // 货名
       getinspectLookGoods({ warehouseId: this.cangid })
         .toPromise()
         .then((response) => {
-          this.goodnameList = []
-          this.goodnameList = response
+          this.goodNameList = []
+          this.goodNameList = response
         })
       // 品级
       packList({ constId: 'CON3' })
@@ -432,7 +643,6 @@ export default {
       getcustomer({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
         .then((response) => {
-          // this.gradeList = response
           this.customerList = []
           let customer = response
           for (let i = 0; i < response.length; i++) {

+ 1 - 0
src/views/houseSelfCollect/inspectionManagement.vue

@@ -66,6 +66,7 @@
       <el-table-column prop="carNumber" label="车牌号"></el-table-column>
       <el-table-column prop="goodsName" label="货名"></el-table-column>
       <el-table-column prop="waterContent" label="水分(%)"></el-table-column>
+       <el-table-column prop="type" label="类型"></el-table-column>
       <el-table-column
         prop="tidalGrainPrice"
         label="净重单价(元/公斤)"

+ 248 - 34
src/views/houseSelfCollect/weighingManagement.vue

@@ -54,15 +54,11 @@
           <span v-else>{{ scope.$index + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        prop="number"
-        width="120"
-        label="编号"
-      ></el-table-column>
+      <el-table-column prop="number" width="120" label="编号"></el-table-column>
       <el-table-column prop="customer" label="客户"></el-table-column>
       <el-table-column prop="carNumber" label="车牌号"></el-table-column>
       <el-table-column prop="goodsName" label="货名"></el-table-column>
-  <el-table-column prop="type" label="类型"></el-table-column>
+      <el-table-column prop="type" label="类型"></el-table-column>
       <el-table-column
         prop="grossWeight"
         label="毛重(公斤)"
@@ -70,7 +66,11 @@
       <el-table-column prop="tare" label="皮重(公斤)"></el-table-column>
       <el-table-column prop="binNumber" label="仓位号"></el-table-column>
       <el-table-column prop="storageNumber" label="囤位号"></el-table-column>
-      <el-table-column prop="secretaryWeigher" label="司称员"></el-table-column>
+      <el-table-column prop="secretaryWeigher" label="司称员">
+       <template slot-scope="scope">
+         {{scope.row.secretaryWeigher}}{{scope.row.skinInspector}}
+       </template> 
+      </el-table-column>
       <el-table-column
         prop="suqualityTestingDate"
         label="称重时间"
@@ -78,10 +78,23 @@
       <el-table-column prop="status" label="状态"></el-table-column>
       <el-table-column width="300" prop="contractNo1" label="操作">
         <template slot-scope="scope">
-
-        <el-button @click="weightCheck(scope.row,1)" v-if="(scope.row.status !='已称皮重'&& scope.row.status =='已质检')">毛重</el-button>
-        <el-button @click="weightCheck(scope.row,2)" v-if="scope.row.status =='已称毛重' || scope.row.status =='已称皮重'">皮重</el-button>
-        <el-button @click="print" v-if="scope.row.status =='已称皮重'">打印</el-button>
+          <el-button
+            @click="weightCheck(scope.row, 1)"
+            v-if="
+              scope.row.status == '已称毛重' || scope.row.status == '已质检'
+            "
+            >毛重</el-button
+          >
+          <el-button
+            @click="weightCheck(scope.row, 2)"
+            v-if="
+              scope.row.status == '已称毛重' || scope.row.status == '已称皮重'
+            "
+            >皮重</el-button
+          >
+          <el-button @click="print(scope.row)" v-if="scope.row.status == '已称皮重'"
+            >打印</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
@@ -96,10 +109,110 @@
       >
       </el-pagination>
     </div>
+
+    <el-dialog
+      width="70%"
+      class="table-content"
+      center
+      :visible.sync="isShowPrint"
+      title="粮食检斤单"
+      id="dialog"
+    >
+     <div class="number">{{dialogData.number}}</div>
+      <table class="table">
+        
+        <tr class="row">
+          <td class="row col-bgc">客户姓名</td>
+          <td colspan="2">{{dialogData.customer}}</td>
+          <td class="row col-bgc">客户电话</td>
+          <td>{{dialogData.customerPhone}}</td>
+          <td class="row col-bgc">车牌号</td>
+          <td colspan="2">{{dialogData.carNumber}}</td>
+         
+        </tr>
+        <tr class="row">
+          <td class="row col-bgc">收货单位</td>
+          <td colspan="2">{{dialogData.compName}}</td>
+          <td class="row col-bgc">联系人</td>
+          <td>{{dialogData.person}}</td>
+          <td class="row col-bgc"> 联系电话</td>
+          <td colspan="2">{{dialogData.personPhone}}</td>
+          
+        </tr>
+        <tr class="row">
+          <td class="row col-bgc">货名</td>
+          <td>{{dialogData.goodsName}}</td>
+          <td class="row col-bgc">类型</td>
+          <td>{{dialogData.type}}</td>
+          <td class="row col-bgc">容重(克/升)</td>
+          <td>{{dialogData.qualityInspectionManagement.bulkDensity}}</td>
+          <td class="row col-bgc"> 不完整粒(%)</td>
+          <td class="row "> {{dialogData.qualityInspectionManagement.imperfectGrain}}</td>
+        </tr>
+        <tr class="row">
+          <td class="row col-bgc">等级</td>
+          <td>{{dialogData.qualityInspectionManagement.grade}}</td>
+          <td class="row col-bgc">水分(%)</td>
+          <td>{{dialogData.qualityInspectionManagement.waterContent}}</td>
+          <td class="row col-bgc"> 热损伤(%)</td>
+          <td>{{dialogData.qualityInspectionManagement.jiaorenli}}</td>
+          <td colspan="2" class="row col-bgc">质检 {{dialogData.qualityInspectionManagement.suqualityTestingDate}}</td>
+        </tr>
+        <tr class="row">
+          <td class="row col-bgc">杂质(%)</td>
+          <td>{{dialogData.qualityInspectionManagement.impurity}}</td>
+          <td class="row col-bgc">霉变粒(%)</td>
+          <td>{{dialogData.qualityInspectionManagement.mildewGrain}}</td>
+          <td class="row col-bgc">扣杂(公斤)</td>
+          <td>{{dialogData.buckleMiscellaneous}}</td>
+          <td class="row col-bgc">净重(公斤)</td>
+          <td>{{dialogData.netWeight}}</td>
+        </tr>
+        <tr class="row">
+          <td class="row col-bgc">毛重(公斤)</td>
+          <td>{{dialogData.grossWeight}}</td>
+          <td class="row col-bgc">皮重(公斤)</td>
+          <td>{{dialogData.tare}}</td>
+          <td colspan="4"></td>
+        </tr>
+        <tr class="row">
+          <td colspan="2" class="row col-bgc">毛重检斤时间</td>
+          <td colspan="2">{{dialogData.grossDate}}</td>
+          <td colspan="2" class="row col-bgc">皮重检斤时间</td>
+          <td colspan="2">{{dialogData.tareDate}}</td>
+        </tr>
+        
+      </table>
+      <div class="bottom">
+        <div class="bottom-row1">
+          <div>毛检:{{dialogData.secretaryWeigher}}</div>
+          <!-- <div>{{ }}</div> -->
+            <div style="margin-left:60px">皮检:{{ dialogData.skinInspector}}</div>
+          <!-- <div>{{ }}</div> -->
+        </div>
+        <div class="bottom-row2">
+          <div class="left">
+            <img src="../../../public/img/add.png" alt="" />
+          </div>
+          <div class="config">收货单位签名或盖章:</div>
+          <div class="autograph">客户签名:</div>
+        </div>
+        <div class="bottom-row3">扫一扫</div>
+        <div class="bottom-row4">
+          <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
+          <el-button type="primary" @click="printSmall">打印小票</el-button>
+          <el-button type="primary" @click="printBig">打印单据</el-button>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
-import { getweighingList, selectWarehouseSelf } from '@/model/houseSelfCollect/index'
+import {
+  getweighingList,
+  selectWarehouseSelf,
+  getPrint
+} from '@/model/houseSelfCollect/index'
 
 export default {
   components: {},
@@ -119,46 +232,81 @@ export default {
       warehouseName: '',
       value1: '', //选择时间
       warehouseList: [],
-      warehouseId:"",
+      warehouseId: '',
+      isShowPrint:false,//打印弹出
+      dialogData:{
+        qualityInspectionManagement:{},
+      },
+      purchasePriceList:[],
     }
   },
   activated() {
     this.getList()
   },
   methods: {
+    print(row) {
+       getPrint({
+      id:row.id
+      })
+        .toPromise()
+        .then((response) => {
+           this.dialogData = response
+           this.isShowPrint = true
+           console.log(this.dialogData)
+        })
+        .catch((response) => {
+          // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+        })
+    },
+    printSmall(){
+      window.location.href =
+        '../../../static/weightCheck.html?type=1&dialogData=' +
+        JSON.stringify(this.dialogData)
+    },
+    printBig(){
+      window.location.href =
+        '../../../static/weightCheck.html?type=2&dialogData=' +
+        JSON.stringify(this.dialogData)
+    },
     warehouseNameChange(e) {
       // this.warehouseName = e
-      console.log(this.warehouseList )
-      for(let i = 0 ; i < this.warehouseList.length ; i++){
-        if(this.warehouseList[i].value == e){
+      console.log(this.warehouseList)
+      for (let i = 0; i < this.warehouseList.length; i++) {
+        if (this.warehouseList[i].value == e) {
           this.warehouseId = this.warehouseList[i].warehouseId
+         this.purchasePriceList = this.warehouseList[i].warehouseList
         }
-
       }
     },
-    weightCheck(row,num) {
+    weightCheck(row, num) {
       this.$router.push({
         path: 'weightCheck',
-        query: { tpyeNo: num ,id:row.id,number:row.number,binNumber:row.binNumber,customer:row.customer,storageNumber:row.storageNumber,carNumber:row.carNumber,goodsName:row.goodsName,grossWeight:row.grossWeight,tare:row.tare,netWeight:row.netWeight,relationId:row.relationId,warehouseId:this.warehouseId},
+        query: {
+          tpyeNo: num,
+          id: row.id,
+          number: row.number,
+          binNumber: row.binNumber,
+          customer: row.customer,
+          storageNumber: row.storageNumber,
+          carNumber: row.carNumber,
+          goodsName: row.goodsName,
+          grossWeight: row.grossWeight,
+          tare: row.tare,
+          netWeight: row.netWeight,
+          relationId: row.relationId,
+          warehouseId: this.warehouseId,
+          purchasePriceList: this.purchasePriceList
+        },
       })
     },
     // Reacquire() {
     //   //重新获取
     // },
-    find(){
+    find() {
       this.getList()
-
     },
 
-    print() {
-      let newstr = document.getElementById('print').innerHTML
-      let oldstr = document.body.innerHTML
-      document.body.innerHTML = newstr
-      window.print()
-      document.body.innerHTML = oldstr
-      // window.location.reload()
-      this.$router.push({ path: 'paymentManagement' })
-    },
+  
     handleSizeChange(val) {
       console.log(`每页 ${val} 条`)
       this.pageSize = val
@@ -180,11 +328,13 @@ export default {
           for (let i = 0; i < response.length; i++) {
             this.warehouseList.push({
               value: response[i].warehouseName,
-              warehouseId :response[i].id
+              warehouseId: response[i].id,
+              warehouseList:response[i].purchasePriceList
             })
           }
-          this.warehouseName =  this.warehouseList[0].value
+          this.warehouseName = this.warehouseList[0].value
           this.warehouseId = this.warehouseList[0].warehouseId
+          this.purchasePriceList = this.warehouseList[0].warehouseList
         })
       getweighingList({
         compId: sessionStorage.getItem('ws-pf_compId'),
@@ -199,9 +349,8 @@ export default {
           //   title: '成功',
           //   message: '删除成功',
           // })
-          this.weighingList = response.records 
+          this.weighingList = response.records
           this.deptBudgetTotal = response.total
-          
         })
         .catch((response) => {
           // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
@@ -242,4 +391,69 @@ export default {
 .formItem {
   width: 51% !important;
 }
+/deep/.el-dialog__title {
+  font-size: 24px !important;
+}
+/deep/.el-dialog__header {
+  text-align: center !important;
+  padding: 10px 0 !important;
+  height: auto !important;
+}
+.number {
+  text-align: right;
+  margin: 0 0 10px 0;
+}
+table,
+table tr th,
+table tr td {
+  border: 2px solid #333333;
+  padding: 5px 0;
+}
+
+table {
+  width: 100%;
+  min-height: 25px;
+  line-height: 25px;
+  text-align: center;
+  border-collapse: collapse;
+  border: 3px solid #333333;
+}
+.col-bgc {
+  background: #f6f7fb;
+}
+.bottom-row1 {
+  display: flex;
+  // justify-content: space-between;
+  margin: 10px 0;
+}
+
+.bottom-row2 {
+  display: flex;
+  margin: 10px 0;
+
+  .left {
+    img {
+      width: 41px;
+      height: 41px;
+      margin-right: 118px;
+    }
+  }
+
+  .config {
+    margin-top: 20px;
+    margin-right: 240px;
+  }
+  .autograph{
+    margin-top: 20px;
+  }
+}
+
+.bottom-row3 {
+  margin: 10px 0;
+}
+
+.bottom-row4 {
+  margin-top: 50px;
+  text-align: center;
+}
 </style>

+ 149 - 32
src/views/houseSelfCollect/weightCheck.vue

@@ -120,7 +120,6 @@
                 <ws-input
                   v-model="weighingList.buckleMiscellaneous"
                   @change="calculation"
-                  number
                   placeholder="请输入扣杂"
                   maxlength="100"
                   size="small"
@@ -156,23 +155,30 @@
         </div>
       </ws-form>
     </div>
+    <!-- <weighingManagement></weighingManagement> -->
   </div>
 </template>
 <script>
-import { tare, grossWeight } from '@/model/houseSelfCollect/index'
+import { tare, grossWeight, getamount } from '@/model/houseSelfCollect/index'
+// import weighingManagement from './weighingManagement.vue'
 export default {
+  components: {
+    // weighingManagement,
+  },
   data() {
     return {
       inspect: {},
       types: 1,
       information: '',
       weighingList: {
+        grossWeight:"",
         buckleMiscellaneous: 0,
       },
       tpyeNo: '',
       disabled: false,
       relationId: '',
       warehouseId: '',
+      purchasePriceList: [],
     }
   },
   activated() {
@@ -186,6 +192,8 @@ export default {
     this.weighingList.id = this.$route.query.id
     this.relationId = this.$route.query.relationId
     this.warehouseId = this.$route.query.warehouseId
+    this.weighingList.grossWeight = this.$route.query.grossWeight
+    this.purchasePriceList = this.$route.query.purchasePriceList
     if (this.tpyeNo == 1) {
       this.information = '毛重'
     } else if (this.tpyeNo == 2) {
@@ -202,36 +210,139 @@ export default {
       this.$router.push({ path: 'weighingManagement' })
     },
     calculation() {
-      if ( this.weighingList.grossWeight  && this.weighingList.tare ) {
-        let  count = 0
-        this.weighingList.netWeight =this.weighingList.grossWeight -this.weighingList.tare-this.weighingList.buckleMiscellaneous
+      if (this.weighingList.grossWeight && this.weighingList.tare) {
+        let count = 0
+        this.weighingList.netWeight =
+          this.weighingList.grossWeight -
+          this.weighingList.tare -
+          this.weighingList.buckleMiscellaneous
       }
     },
     print() {
-      ;(this.weighingList.secretaryWeigher =
-        sessionStorage.getItem('ws-pf_staffName')),
-        this.$confirm('确定保存检斤信息?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
+      if (!this.weighingList.grossWeight) {
+        this.$message({
+          message: '毛重不能为空',
           type: 'warning',
         })
-          .then(() => {
-            if (this.tpyeNo == 1) {
-              this.weighingList.relationId = this.relationId
-              grossWeight(this.weighingList)
-                .toPromise()
-                .then((response) => {
-                  this.$notify.success({
-                    title: '成功',
-                    message: '保存成功',
-                  })
-                  this.$router.go(-1)
-                })
-                .catch((response) => {
-                  // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-                })
-            } else if (this.tpyeNo == 2) {
-              this.weighingList.warehouseId = this.warehouseId
+        return
+      }
+      if (this.weighingList.grossWeight < 1 || this.weighingList.grossWeight > 100000) {
+        this.$message({
+          message: '毛重输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (String(this.weighingList.grossWeight).indexOf('.') != -1 &&  String(this.weighingList.grossWeight).length -
+          (String(this.weighingList.grossWeight).indexOf('.') + 1) >
+          1
+      ) {
+        this.$message({
+          message: '毛重输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if(this.tpyeNo == 2){
+        if (!this.weighingList.tare ) {
+        this.$message({
+          message: '皮重不能为空',
+          type: 'warning',
+        })
+        return
+      }
+       if (!this.weighingList.tare ) {
+        this.$message({
+          message: '皮重不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (this.weighingList.tare < 1 || this.weighingList.tare > 100000) {
+        this.$message({
+          message: '皮重输入错误',
+          type: 'warning',
+        })
+        return
+      }
+       if (String(this.weighingList.tare).indexOf('.') != -1 &&  String(this.weighingList.tare).length -
+          (String(this.weighingList.tare).indexOf('.') + 1) >
+          1
+      ) {
+        this.$message({
+          message: '皮重输入错误',
+          type: 'warning',
+        })
+        return
+      }
+
+      }
+      this.$confirm('确定保存检斤信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          if (this.tpyeNo == 1) {
+            //毛检保存前进行校验
+            getamount({
+              compId: sessionStorage.getItem('ws-pf_compId'),
+              customerName: this.weighingList.customer,
+              goodsName: this.weighingList.goodsName,
+            })
+              .toPromise()
+              .then((response) => {
+                for (let i = 0; i < this.purchasePriceList.length; i++) {
+                  if (
+                    this.weighingList.goodsName ==
+                    this.purchasePriceList[i].goodsName
+                  ) {
+                    //累计售粮超上限不能完成毛检保存
+                    let count = this.purchasePriceList[i].saleLimit - response
+                    if (count - this.weighingList.grossWeight < 0) {
+                      this.$alert(
+                        '该客户累计销售' +
+                          this.weighingList.goodsName +
+                          response +
+                          '吨,还可售粮' +
+                          count +
+                          '吨',
+                        '提示',
+                        {
+                          confirmButtonText: '确定',
+                          callback: (action) => {
+                            this.$message({
+                              type: 'info',
+                              message: `累计售粮已超出上限`,
+                            })
+                          },
+                        }
+                      )
+                    } else {
+                      //累计售粮没有超上限完成毛检保存
+                      this.weighingList.relationId = this.relationId
+                      ;(this.weighingList.secretaryWeigher =
+                        sessionStorage.getItem('ws-pf_staffName')),
+                        grossWeight(this.weighingList)
+                          .toPromise()
+                          .then((response) => {
+                            this.$notify.success({
+                              title: '成功',
+                              message: '保存成功',
+                            })
+                            this.$router.go(-1)
+                          })
+                          .catch((response) => {
+                            // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+                          })
+                    }
+                  }
+                }
+              })
+          } else if (this.tpyeNo == 2) {
+            this.weighingList.warehouseId = this.warehouseId
+            ;(this.weighingList.skinInspector =
+              sessionStorage.getItem('ws-pf_staffName')),
               tare(this.weighingList)
                 .toPromise()
                 .then((response) => {
@@ -239,16 +350,22 @@ export default {
                     title: '成功',
                     message: '保存成功',
                   })
+                  //   let newstr = document.getElementById('dialog').innerHTML
+                  // let oldstr = document.body.innerHTML
+                  // document.body.innerHTML = newstr
+                  // // window.print()
+                  // document.body.innerHTML = oldstr
+                  // window.location.reload()
                   this.$router.go(-1)
                 })
                 .catch((response) => {
                   // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
                 })
-            }
-          })
-          .catch(() => {
-            return false
-          })
+          }
+        })
+        .catch(() => {
+          return false
+        })
     },
   },
 }