瀏覽代碼

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

# Conflicts:
#	public/static/weightCheck.html
mxx 3 年之前
父節點
當前提交
a812bdb43f

+ 2 - 2
.env.production

@@ -4,8 +4,8 @@
 
 NODE_ENV = 'production'
 # base api
-#VUE_APP_BASE_API = 'https://api2.eliangeyun.com'
-VUE_APP_BASE_API = 'https://apitest.eliangeyun.com'
+VUE_APP_BASE_API = 'https://api2.eliangeyun.com'
+#VUE_APP_BASE_API = 'https://apitest.eliangeyun.com'
 
 # 微服务相关接口配置
 ## 任务消息

+ 3 - 2
public/index.html

@@ -11,11 +11,12 @@
   <link rel="icon" href="<%= BASE_URL %>/logo.ico">
   <!-- 强制Chromium内核,作用于其他双核浏览器 -->
   <meta name="force-rendering" content="webkit" />
-
+  <!-- 自动将HTTP请求升级成安全的HTTPS请求 -->
+  <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
   <!-- 如果有安装 Google Chrome Frame 插件则强制为Chromium内核,否则强制本机支持的最高版本IE内核,作用于IE浏览器 -->
   <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
   <link rel="manifest" href="<%= BASE_URL %>/manifest.json" />
-  <link rel="icon" href="<%= BASE_URL %>/logo.ico">
+  <!-- <link rel="icon" href="<%= BASE_URL %>/logo.ico"> -->
   <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css[process.env.VUE_APP_PACKAGE_ENV]) { %>
       <link href="<%= htmlWebpackPlugin.options.cdn.css[process.env.VUE_APP_PACKAGE_ENV][i] %>" rel="stylesheet">
   <% } %>

+ 1 - 1
public/static/print.html

@@ -44,7 +44,7 @@
           <div class="name">{{name}}价格对照表(按水分)</div>
           <div class="price">价格单位:元/公斤</div>
         </div>
-         <el-table :data="tableData" border style="width: 600px" :row-class-name="tableRowClassName">
+         <el-table :data="tableData" style="width: 600px" :row-class-name="tableRowClassName">
            <el-table-column prop="waterMin" label="水分下限(%)">
            </el-table-column>
            <el-table-column prop="waterMax" label="水分上限(%)">

+ 5 - 3
public/static/weightCheck.html

@@ -278,7 +278,9 @@
     new Vue({
       el: '#app',
       data: {
-        tableData: {},
+        tableData: {
+          // qualityInspectionManagement:{}
+        },
         name: "",
         bigContent: false,
         smallContent: false
@@ -311,7 +313,7 @@
         printBig() {},
       },
       mounted() {
-        let _data = decodeURIComponent(this.getQueryVariable("dialogData"))
+        let _data = decodeURIComponent(this.getQueryVariable("tableData"))
         let _type = decodeURIComponent(this.getQueryVariable("type"))
         if (_type == 2) {
           this.bigContent = true
@@ -320,7 +322,7 @@
           this.smallContent = true
           this.bigContent = false
         }
-        console.log(_data)
+        console.log(_data,"sddsd")
         this.tableData = JSON.parse(_data)
         console.log(this.tableData)
         window.print()

+ 5 - 6
src/views/houseSelfCollect/component/inspectInfoPrint.vue

@@ -1,7 +1,6 @@
 <!--质检信息-->
 <template>
   <div class="center">
-    {{printData}}
     <div class="number">{{ printData.qualityNo }}</div>
     <table class="table">
       <tr class="row">
@@ -14,11 +13,11 @@
       </tr>
       <tr class="row">
         <td class="col col-bgc">收货单位</td>
-        <td class="col" colspan="2">{{ printData.receivingUnit }}</td>
+        <td class="col" colspan="2">{{ printData.compName }}</td>
         <td class="col col-bgc">联系人</td>
-        <td class="col" colspan="2">{{ printData.contacts }}</td>
+        <td class="col" colspan="2">{{ printData.person }}</td>
         <td class="col col-bgc">联系电话</td>
-        <td class="col">{{ printData.contactsPhone }}</td>
+        <td class="col">{{printData.personPhone}}</td>
       </tr>
       <tr class="row">
         <td class="col col-bgc">货名</td>
@@ -58,8 +57,8 @@
         <div class="left">
           <img src="../../../../public/img/add.png" alt="" />
         </div>
-        <div class="config">收货单位签名或盖章</div>
-        <div class="">客户签名</div>
+        <div class="config">收货单位签名或盖章</div>
+        <div class="">客户签名</div>
       </div>
       <div class="bottom-row3">扫一扫</div>
       <div class="bottom-row4">

+ 181 - 0
src/views/houseSelfCollect/component/weightCheckPrint.vue

@@ -0,0 +1,181 @@
+<template>
+    <div class="center">
+        <!-- <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="../../../../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">关闭</el-button>
+        <el-button type="primary" @click="printSmall">打印小票</el-button>
+        <el-button type="primary" @click="printBig">打印单据</el-button>
+      </div>
+        </div>
+        
+    </div>
+</template>
+<script>
+
+export default{
+    props: {
+      tableData: {
+        type: Object
+      }
+    },
+      data(){
+          return{
+
+          }
+      },
+      methods:{
+        
+            printSmall() {
+                  console.log(this.tableData,"对象")
+      window.location.href =
+        '../../../../static/weightCheck.html?type=1&tableData=' +
+        JSON.stringify(this.tableData)
+    },
+    printBig() {
+           console.log(this.tableData,"对象")
+      window.location.href =
+        '../../../../static/weightCheck.html?type=2&tableData=' +
+        JSON.stringify(this.tableData)
+    },
+
+      }
+}
+</script>
+<style lang="scss" scoped>
+ .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> 

+ 62 - 61
src/views/houseSelfCollect/inspectInfo.vue

@@ -254,7 +254,7 @@
       :visible.sync="isShowPrint"
       title="粮食质检单"
     >
-    <inspectInfoPrint :printData="inspect"></inspectInfoPrint>
+      <inspectInfoPrint :printData="inspect"></inspectInfoPrint>
     </el-dialog>
   </div>
 </template>
@@ -268,7 +268,7 @@ import {
   getinspectLookGoods,
   getinspectEdit,
   getamount,
-  getCount
+  getCount,
 } from '@/model/houseSelfCollect/index'
 import { packList } from '@/model/contarct/index'
 import inspectInfoPrint from './component/inspectInfoPrint.vue'
@@ -279,7 +279,7 @@ export default {
   watch: {},
   data() {
     return {
-      isShowPrint:false,
+      isShowPrint: false,
       // warehouseList: {},
       inspect: {
         tidalGrainPrice: 0,
@@ -344,7 +344,6 @@ export default {
       // + this.verifyinit()
     },
     print() {
-      this.isShowPrint = true
       // if (!this.inspect.qualityNo) {
       //   this.$message({
       //     message: '编号不能为空',
@@ -549,55 +548,57 @@ export default {
       //       }
       //     }
       //   })
-      // this.inspect.warehouseName = this.warehouseName
-      // this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
-      // this.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
-      // if (this.types == null) {
-      //   this.$confirm('确定保存质检信息?', '提示', {
-      //     confirmButtonText: '确定',
-      //     cancelButtonText: '取消',
-      //     type: 'warning',
-      //   })
-      //     .then(() => {
-      //       inspectAdd(this.inspect)
-      //         .toPromise()
-      //         .then((response) => {
-      //           this.$message.success('保存成功')
-      //           //打印
-      //           // this.$router.go(-1)
-      //         })
-      //     })
-      //     .catch(() => {
-      //       return false
-      //     })
-      // } else if (this.types == 3) {
-      //   this.$confirm('确定保存质检信息?', '提示', {
-      //     confirmButtonText: '确定',
-      //     cancelButtonText: '取消',
-      //     type: 'warning',
-      //   })
-      //     .then(() => {
-      //       // return
-      //       getinspectEdit(this.inspect)
-      //         .toPromise()
-      //         .then((response) => {
-      //           this.$message.success('修改成功')
-      //           // this.xx = true;
-      //           // 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' })
-      //           //打印
-      //           // this.$router.go(-1)
-      //         })
-      //     })
-      //     .catch(() => {
-      //       return false
-      //     })
-      // }
+      this.inspect.warehouseName = this.warehouseName
+      this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
+      this.inspect.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
+      if (this.types == null) {
+        this.$confirm('确定保存质检信息?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+          .then(() => {
+            inspectAdd(this.inspect)
+              .toPromise()
+              .then((response) => {
+                this.$message.success('保存成功')
+                 getinspectLook({ id: response })
+                  .toPromise()
+                  .then((response) => {
+                    this.inspect = response
+                  })
+                this.isShowPrint = true
+                //打印
+                // this.$router.go(-1)
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      } else if (this.types == 3) {
+        this.$confirm('确定保存质检信息?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+          .then(() => {
+            // return
+            getinspectEdit(this.inspect)
+              .toPromise()
+              .then((response) => {
+                this.$message.success('修改成功')
+                getinspectLook({ id: this.inspect.id })
+                  .toPromise()
+                  .then((response) => {
+                    this.inspect = response
+                  })
+                this.isShowPrint = true
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      }
     },
     cancel() {
       this.$router.push({ path: 'inspectionManagement' })
@@ -690,15 +691,15 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
-  /deep/.el-dialog__header {
-    text-align: center !important;
-    padding: 10px 0 !important;
-    height: auto !important;
-  }
+/deep/.el-dialog__header {
+  text-align: center !important;
+  padding: 10px 0 !important;
+  height: auto !important;
+}
 
-  /deep/.el-dialog__title {
-    font-size: 24px !important;
-  }
+/deep/.el-dialog__title {
+  font-size: 24px !important;
+}
 .center {
   background: #f6f7fc;
 }

+ 18 - 18
src/views/houseSelfCollect/weighingManagement.vue

@@ -118,9 +118,8 @@
       title="粮食检斤单"
       id="dialog"
     >
-     <div class="number">{{dialogData.number}}</div>
+     <!-- <div class="number">{{dialogData.number}}</div>
       <table class="table">
-        
         <tr class="row">
           <td class="row col-bgc">客户姓名</td>
           <td colspan="2">{{dialogData.customer}}</td>
@@ -186,9 +185,8 @@
       <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">
@@ -203,7 +201,8 @@
           <el-button type="primary" @click="printSmall">打印小票</el-button>
           <el-button type="primary" @click="printBig">打印单据</el-button>
         </div>
-      </div>
+      </div> -->
+      <weightCheckPrint :tableData="dialogData"></weightCheckPrint>
     </el-dialog>
   </div>
 </template>
@@ -213,9 +212,12 @@ import {
   selectWarehouseSelf,
   getPrint
 } from '@/model/houseSelfCollect/index'
+import weightCheckPrint from './component/weightCheckPrint.vue'
 
 export default {
-  components: {},
+  components: {
+    weightCheckPrint
+  },
   watch: {},
   data() {
     return {
@@ -252,25 +254,23 @@ export default {
         .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)
-    },
+    // 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) {
           this.warehouseId = this.warehouseList[i].warehouseId

+ 79 - 49
src/views/houseSelfCollect/weightCheck.vue

@@ -155,15 +155,23 @@
         </div>
       </ws-form>
     </div>
-    <!-- <weighingManagement></weighingManagement> -->
+    <el-dialog
+      width="70%"
+      class="table-content"
+      center
+      :visible.sync="isShowPrint"
+      title="粮食检斤单"
+    >
+      <weightCheckPrint :tableData="inspect"></weightCheckPrint>
+    </el-dialog>
   </div>
 </template>
 <script>
-import { tare, grossWeight, getamount } from '@/model/houseSelfCollect/index'
-// import weighingManagement from './weighingManagement.vue'
+import { tare, grossWeight, getamount,getPrint } from '@/model/houseSelfCollect/index'
+import weightCheckPrint from './component/weightCheckPrint.vue'
 export default {
   components: {
-    // weighingManagement,
+    weightCheckPrint,
   },
   data() {
     return {
@@ -171,7 +179,7 @@ export default {
       types: 1,
       information: '',
       weighingList: {
-        grossWeight:"",
+        grossWeight: '',
         buckleMiscellaneous: 0,
       },
       tpyeNo: '',
@@ -179,6 +187,7 @@ export default {
       relationId: '',
       warehouseId: '',
       purchasePriceList: [],
+      isShowPrint: false,
     }
   },
   activated() {
@@ -226,14 +235,19 @@ export default {
         })
         return
       }
-      if (this.weighingList.grossWeight < 1 || this.weighingList.grossWeight > 100000) {
+      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 -
+      if (
+        String(this.weighingList.grossWeight).indexOf('.') != -1 &&
+        String(this.weighingList.grossWeight).length -
           (String(this.weighingList.grossWeight).indexOf('.') + 1) >
           1
       ) {
@@ -243,39 +257,40 @@ export default {
         })
         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
-      }
-
+      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: '确定',
@@ -340,23 +355,30 @@ export default {
                 }
               })
           } else if (this.tpyeNo == 2) {
+            
             this.weighingList.warehouseId = this.warehouseId
-            ;(this.weighingList.skinInspector =
-              sessionStorage.getItem('ws-pf_staffName')),
+           this.weighingList.skinInspector =sessionStorage.getItem('ws-pf_staffName'),
               tare(this.weighingList)
                 .toPromise()
                 .then((response) => {
+                  console.log(response)
                   this.$notify.success({
                     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)
+                  getPrint({
+                    id: response,
+                  })
+                    .toPromise()
+                    .then((response) => {
+                      this.inspect = response
+                      this.isShowPrint = true
+                      console.log(this.dialogData)
+                    })
+                    .catch((response) => {
+                      // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+                    })
+              
                 })
                 .catch((response) => {
                   // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
@@ -455,4 +477,12 @@ export default {
 .butCss {
   opacity: 0;
 }
+/deep/.el-dialog__title {
+  font-size: 24px !important;
+}
+/deep/.el-dialog__header {
+  text-align: center !important;
+  padding: 10px 0 !important;
+  height: auto !important;
+}
 </style>