gjy 3 роки тому
батько
коміт
633c2e4da2

+ 305 - 11
public/static/payprint.html

@@ -4,11 +4,272 @@
     <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-right: 240px;
+      }
+
+      .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">
-      {{dataList}}
-       <el-button @click="visible = true">Button</el-button>
+      <div class="content" v-if="bigContent">
+        <div class="title">粮食质检单</div>
+        <div class="number">{{tableData.qualityNo}}</div>
+        <table class="table">
+          <tr class="row">
+            <td class="col col-bgc">客户姓名</td>
+            <td class="col" colspan="2">{{tableData.customerName}}</td>
+            <td class="col col-bgc">客户电话</td>
+            <td class="col" colspan="2">{{tableData.customerPhone}}</td>
+            <td class="col col-bgc">车牌号</td>
+            <td class="col">{{tableData.carNumber}}</td>
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc">收货单位</td>
+            <td class="col" colspan="2">{{tableData.receivingUnit}}</td>
+            <td class="col col-bgc">联系人</td>
+            <td class="col" colspan="2">{{tableData.contacts}}</td>
+            <td class="col col-bgc">联系电话</td>
+            <td class="col">{{tableData.contactsPhone}}</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.customerName}}</td>
+            <td class="col col-bgc">容量(克/升)</td>
+            <td class="col">{{tableData.bulkDensity}}</td>
+            <td class="col col-bgc">不完整粒(%)</td>
+            <td class="col">{{tableData.imperfectGrain}}</td>
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc">等级</td>
+            <td class="col">{{tableData.grade}}</td>
+            <td class="col col-bgc">水分(%)</td>
+            <td class="col">{{tableData.waterContent}}</td>
+            <td class="col col-bgc">热损伤(%)</td>
+            <td class="col">{{tableData.jiaorenli}}</td>
+            <td class="col col-bgc">单价(元/公斤)</td>
+            <td class="col">{{tableData.tidalGrainPrice}}</td>
+          </tr>
+          <tr class="row">
+            <td class="col col-bgc">杂质(%)</td>
+            <td class="col">{{tableData.impurity}}</td>
+            <td class="col col-bgc">霉变粒(%)</td>
+            <td class="col">{{tableData.mildewGrain}}</td>
+            <td class="col col-bgc" colspan="2">购粮性质</td>
+            <td class="col" colspan="2">{{tableData.customerName}}</td>
+          </tr>
+        </table>
+        <div class="bottom">
+          <div class="bottom-row1">
+            <div>质检:{{tableData.qualityInspector}}</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="">客户签名</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.qualityNo}}</div>
+        </div>
+        <div class="small-row">
+          <div>客户姓名</div>
+          <div>{{tableData.customerName}}</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.receivingUnit}}</div>
+        </div>
+        <div class="small-row">
+          <div>联系人</div>
+          <div>{{tableData.contacts}}</div>
+        </div>
+        <div class="small-row">
+          <div>联系电话</div>
+          <div>{{tableData.contactsPhone}}</div>
+        </div>
+        <div class="small-row">
+          <div>货名</div>
+          <div>{{tableData.goodsName}}</div>
+        </div>
+        <div class="small-row">
+          <div>类型</div>
+          <div>{{tableData.customerName}}</div>
+        </div>
+        <div class="small-row">
+          <div>容量(克/升)</div>
+          <div>{{tableData.bulkDensity}}</div>
+        </div>
+        <div class="small-row">
+          <div>不完整粒(%)</div>
+          <div>{{tableData.imperfectGrain}}</div>
+        </div>
+        <div class="small-row">
+          <div>等级</div>
+          <div>{{tableData.grade}}</div>
+        </div>
+        <div class="small-row">
+          <div>水分(%)</div>
+          <div>{{tableData.waterContent}}</div>
+        </div>
+        <div class="small-row">
+          <div>热损伤(%)</div>
+          <div>{{tableData.jiaorenli}}</div>
+        </div>
+        <div class="small-row">
+          <div>单价(元/公斤)</div>
+          <div>{{tableData.tidalGrainPrice}}</div>
+        </div>
+        <div class="small-row">
+          <div>杂质(%)</div>
+          <div>{{tableData.impurity}}</div>
+        </div>
+        <div class="small-row">
+          <div>>霉变粒(%)</div>
+          <div>{{tableData.mildewGrain}}</div>
+        </div>
+        <div class="small-row">
+          <div>购粮性质</div>
+          <div>{{tableData.customerName}}</div>
+        </div>
+        <div class="small-row">
+          <div>质检</div>
+          <div>{{tableData.qualityInspector}}</div>
+        </div>
+        <div class="small-row">
+          <div>时间</div>
+          <div>{{tableData.qualityDate}}</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>
@@ -17,24 +278,57 @@
     new Vue({
       el: '#app',
       data: {
-        dataList: ""
+        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 = localStorage.getItem("pricePrintList")
-        // var _data = decodeURIComponent(this.getQueryVariable("id"))
-        console.log(_data)
-        this.dataList = JSON.parse(_data)
+      mounted() {
+        let _data = decodeURIComponent(this.getQueryVariable("dataList"))
+        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: {
-      }
+      watch: {}
     })
   </script>
 

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

@@ -60,4 +60,6 @@ export const API_GET_INSPECT_GETAMOUNT = '/paymentManagement/cumulant'
 export const API_GET_CUSTOMER_GETIDENTITY = '/driverViewInfo/personShibie'
 //付款删除
 export const API_POST_PAYMENT_DEL = '/paymentManagement/api/deleteInfo'
+//付款审核
+export const API_POST_PAYMENT_AUDIT = '/paymentManagement/api/openAuditFlow'
 

+ 4 - 1
src/model/houseSelfCollect/index.js

@@ -32,7 +32,8 @@ import {
   API_POST_PAYMENT_EDIT,
   API_GET_INSPECT_GETAMOUNT,
   API_GET_CUSTOMER_GETIDENTITY,
-  API_POST_PAYMENT_DEL
+  API_POST_PAYMENT_DEL,
+  API_POST_PAYMENT_AUDIT
 } from '@/api/V2/houseSelfCollect'
 //客户管理列表
 export const getCustomerManage = appRx.get(API_GET_CUSTOMER_MANAGE, errorCatcher, errorHandle, filter)
@@ -97,3 +98,5 @@ export const getamount = appRx.get(API_GET_INSPECT_GETAMOUNT, errorCatcher, erro
 export const getIdentity  = appRx.get(API_GET_CUSTOMER_GETIDENTITY, errorCatcher, errorHandle, filter)
 //付款删除
 export const delpayment  = appRx.post(API_POST_PAYMENT_DEL, errorCatcher, errorHandle, filter)
+//付款审核
+export const auditpayment  = appRx.post(API_POST_PAYMENT_AUDIT, errorCatcher, errorHandle, filter)

+ 2 - 1
src/views/financialManagement/collectionManagementList.vue

@@ -630,7 +630,8 @@ export default {
             boxNo: '',
             titleNo: '',
             tranCarNo: tmp,
-            agent: this.agent
+            agent: this.agent,
+            staffId: this.staffId
           })
           // for (var i = 0; i < this.freightspace.length; i++) {
           //   var index = i + 1

+ 86 - 28
src/views/houseSelfCollect/acquisitionManagement.vue

@@ -32,6 +32,8 @@
         <el-table-column prop="waterBase" label="基准水分(%)"></el-table-column>
         <el-table-column prop="deductWeight" label="扣重比"></el-table-column>
         <el-table-column prop="saleLimit" label="销量上线"></el-table-column>
+        <el-table-column prop="dryGrainPrice" label="干粮收购价"></el-table-column>
+
         <el-table-column prop="status" label="状态"></el-table-column>
         <el-table-column prop="passDate" label="通过时间"></el-table-column>
         <el-table-column label="操作" width="300">
@@ -47,13 +49,7 @@
         :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper"
         :total="deptBudgetTotal">
       </el-pagination>
-      <el-popover placement="center" width="160" v-model="visible">
-        <p>这是一段内容这是一段内容确定删除吗?</p>
-        <div style="text-align: right; margin: 0">
-          <el-button size="mini" type="text" @click="visible = false">取消</el-button>
-          <el-button type="primary" size="mini" @click="visible = false">确定</el-button>
-        </div>
-      </el-popover>
+
     </div>
   </div>
 </template>
@@ -62,7 +58,8 @@
     getPurchasePrice,
     selectWarehouseSelf,
     purchasePriceAllowEdit,
-    purchasePriceLook
+    purchasePriceLook,
+    purchasePriceDel
   } from '@/model/houseSelfCollect/index'
   import acquisitionManagementAdd from './acquisitionManagementAdd.vue'
   export default {
@@ -86,21 +83,35 @@
         accountName: '',
         tableData: [],
         selectVal: '',
-        goodsNameList:[],
-        warehouseList:[]
+        goodsNameList: [],
+        warehouseList: [],
+        userJurisdiction:0
       }
     },
-    activated() {},
-    computed() {},
-    created() {
+    activated() {
       //获取公司id
       this.compId = sessionStorage.getItem('ws-pf_compId')
       //用户名
       this.accountName = sessionStorage.getItem('ws-pf_staffName')
       this.getWarehouseSelf()
+      //获取用户权限,决策人、统计
+      this.getUserJurisdiction()
+    },
+    computed() {},
+    created() {
+
 
     },
     methods: {
+      getUserJurisdiction(){
+       if(true){
+         //决策人
+         this.userJurisdiction = 1
+       }else{
+         // 统计
+          this.userJurisdiction = 0
+       }
+      },
       handleSizeChange(val) {
         console.log(`每页 ${val} 条`)
         this.pageSize = val
@@ -113,6 +124,17 @@
       },
       warehouseChange(e) {
         console.log(e)
+        let _obj = this.warehouseList.find((item) => {
+          return item.id === this.selectVal;
+        });
+        if (_obj.allowEdit == 1) {
+
+          this.checked = true
+        } else {
+          this.checked = false
+        }
+        console.log(_obj)
+
       },
       newAcquisition(index, row, type) {
         let _obj = {}
@@ -128,14 +150,14 @@
               warehouseName: _obj.warehouseName,
               compId: this.compId,
               type: type,
-              goodsNameList:this.goodsNameList
+              goodsNameList: this.goodsNameList
             }
             break
           case '编辑':
             break
           case "查看":
             _query = {
-              data:JSON.stringify(row),
+              data: JSON.stringify(row),
               type: type
             }
             break
@@ -156,6 +178,12 @@
           console.log(response)
           this.warehouseList = response
           this.selectVal = this.warehouseList[0].id
+          if (this.warehouseList[0].allowEdit == 1) {
+
+            this.checked = true
+          } else {
+            this.checked = false
+          }
           // this.tableData = response.records
           this.getList()
         })
@@ -169,15 +197,18 @@
           compId: this.compId,
         }).toPromise().then((response) => {
           console.log(response)
-          for(let i=0;i<response.records.length;i++){
+          for (let i = 0; i < response.records.length; i++) {
             this.goodsNameList.push(response.records[i].goodsName)
           }
           this.tableData = response.records
         })
       },
       allowEdit(val) {
-        console.log(val)
-        purchasePriceAllowEdit({}).toPromise().then((response) => {
+        console.log(this.selectVal)
+        purchasePriceAllowEdit({
+          warehouseId: this.selectVal
+        }).toPromise().then((response) => {
+
           console.log(response)
           // this.tableData = response.records
         })
@@ -185,19 +216,46 @@
       handleEdit(index, row) {
         console.log(index, row);
       },
+      // 删除
       delRow(index, row) {
-        this.visible = true
         console.log(index, row);
-      },
-      print(index,row) {
-      // 打印价格对照表
-     purchasePriceLook({id:row.id}).toPromise().then((response) => {
-            console.log(response.detailPrints)
-            // this.tableData = response.records
-            // this.getList()
-            localStorage.setItem('pricePrintList', JSON.stringify(response.detailPrints));
-            window.location.href="../../../static/print.html?name="+row.goodsName
+        //删除
+        this.$confirm('确定删除该条设置?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            purchasePriceDel({
+                id: row.id,
+              })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '删除成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
           })
+          .catch(() => {
+            return false
+          })
+      },
+      print(index, row) {
+        // 打印价格对照表
+        purchasePriceLook({
+          id: row.id
+        }).toPromise().then((response) => {
+          console.log(response.detailPrints)
+          // this.tableData = response.records
+          // this.getList()
+          localStorage.setItem('pricePrintList', JSON.stringify(response.detailPrints));
+          window.location.href = "../../../static/print.html?name=" + row.goodsName
+        })
       }
     },
   }

+ 101 - 41
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -27,6 +27,11 @@
               <el-input v-model="baseInfoForm.deductWeight"></el-input>
             </el-form-item>
           </div>
+          <div class="grid-content">
+            <el-form-item label="干粮收购价格">
+              <el-input v-model="baseInfoForm.dryGrainPrice"></el-input>
+            </el-form-item>
+          </div>
         </div>
         <div class="row2">
           <div class="grid-content">
@@ -227,6 +232,7 @@
           workflowId: '',
           approveStatus: '',
           passDate: '',
+          dryGrainPrice: '',
           details: [],
           detailPrints: []
         },
@@ -238,16 +244,16 @@
     activated() {
       switch (this.$route.query.type) {
         case "新增":
-        let _goodsNameList = []
-        this.baseInfoForm.warehouseId = this.$route.query.warehouseId
-        this.baseInfoForm.warehouseName = this.$route.query.warehouseName
-        this.baseInfoForm.compId = this.$route.query.compId
-        this.type = this.$route.query.type
-        console.log(this.baseInfoForm)
-        _goodsNameList = this.$route.query.goodsNameList
-        this.priceList[0].detailList[0].water = this.baseInfoForm.waterMin
-        this.priceList[0].detailList[2].water = this.baseInfoForm.waterBase
-        this.priceList[0].detailList[4].water = this.baseInfoForm.waterMax
+          let _goodsNameList = []
+          this.baseInfoForm.warehouseId = this.$route.query.warehouseId
+          this.baseInfoForm.warehouseName = this.$route.query.warehouseName
+          this.baseInfoForm.compId = this.$route.query.compId
+          this.type = this.$route.query.type
+          console.log(this.baseInfoForm)
+          _goodsNameList = this.$route.query.goodsNameList
+          this.priceList[0].detailList[0].water = this.baseInfoForm.waterMin
+          this.priceList[0].detailList[2].water = this.baseInfoForm.waterBase
+          this.priceList[0].detailList[4].water = this.baseInfoForm.waterMax
           // 货名
           packList({
               constId: 'CON2'
@@ -274,12 +280,14 @@
         case "编辑":
           break;
         case "查看":
-         this.baseInfoForm =JSON.parse(this.$route.query.data)
-       purchasePriceLook({id:this.baseInfoForm.id}).toPromise().then((response) => {
-              console.log(response)
-              // this.tableData = response.records
-              // this.getList()
-            })
+          this.baseInfoForm = JSON.parse(this.$route.query.data)
+          purchasePriceLook({
+            id: this.baseInfoForm.id
+          }).toPromise().then((response) => {
+            console.log(response)
+            // this.tableData = response.records
+            // this.getList()
+          })
           break;
         default:
           break
@@ -499,7 +507,10 @@
       },
       closeCount() {
         this.isCountShow = true
-        this.splitPriceList = []
+        // this.splitPriceList = []
+        // this.$router.push({
+        //   name: 'acquisitionManagement',
+        // })
       },
       //处理表格数据
       makeTableList() {
@@ -512,8 +523,7 @@
 
         // 获取等级对应分界钱数
         this.getSplitPrice()
-        // 分界价钱数据
-        // this.splitPriceList
+        // 构造表格等差数列
         let _list = []
         let _obj = {}
         let _waterMin = parseFloat(this.baseInfoForm.waterMin)
@@ -546,9 +556,8 @@
         }
         this.tableData = _list
       },
-      // 获取分界价格数据
+      // 获取分界价格数据,构造分界价格区间数据
       getSplitPrice() {
-
         let _priceList = this.priceList
         for (let i = 0; i < _priceList.length; i++) {
           for (let k = 0; k < _priceList[i].checkList.length; k++) {
@@ -563,6 +572,7 @@
               }
               if (_priceList[i].detailList[j].type != 4 && _priceList[i].detailList[j].type != 3) {
                 _obj.priceList.push({
+                  index: j,
                   type: parseFloat(_priceList[i].detailList[j].type),
                   priceStart: parseFloat(_priceList[i].detailList[j].water),
                   priceEnd: parseFloat(_priceList[i].detailList[j + 2].water),
@@ -574,13 +584,56 @@
             }
             console.log(_obj)
             this.splitPriceList.push(_obj)
-
             console.log(this.splitPriceList)
           }
         }
       },
-      getOtherPrice(list) {
-
+      // 获取当前价格左右价格区间数据
+      getOtherPrice(list, nowList, direction) {
+
+        //判断当前价格左右各有几个分界
+        let _left = []
+        let _right = []
+        let _leftTotalPrice = 0
+        let _rightTotalPrice = 0
+        if (direction == "leftBasic") {
+          for (let i = 0; i < list.length; i++) {
+            if (nowList.index <= list[i].index && list[i].priceStart < 30) {
+              _right.push(list[i])
+            } else if (list[i].priceStart < 30) {
+              _left.push(list[i])
+            }
+          }
+          if (_left.length > 0) {
+            for (let j = 0; j < _left.length; j++) {
+              _leftTotalPrice += _left[j].totalPrice
+            }
+          }
+          if (_right.length > 0) {
+            for (let k = 0; k < _right.length; k++) {
+              _rightTotalPrice += _right[k].totalPrice
+            }
+          }
+        } else {
+          for (let m = 0; m < list.length; m++) {
+            if (nowList.index <= list[m].index && list[m].priceStart > 30) {
+              _left.push(list[m])
+            } else if (list[m].priceStart > 30) {
+              _right.push(list[m])
+            }
+          }
+        }
+        if (_left.length > 0) {
+          for (let j = 0; j < _left.length; j++) {
+            _leftTotalPrice += _left[j].totalPrice
+          }
+        }
+        if (_right.length > 0) {
+          for (let k = 0; k < _right.length; k++) {
+            _rightTotalPrice += _right[k].totalPrice
+          }
+        }
+        return _leftTotalPrice + _rightTotalPrice
       },
       // 计算价格
       calculatePrice(_waterMin) {
@@ -598,38 +651,45 @@
             if (_waterMin < parseFloat(this.baseInfoForm.waterBase)) {
               if (_waterMin >= _list[k].priceStart && _waterMin < _list[k].priceEnd && !this.splitPriceList[i]
                 .haveSplit) {
-                _price = basePrice + (parseFloat(this.baseInfoForm.waterBase) - _waterMin) / 0.5 *
-                  _list[k].betweenPrice
-                prcieList.push(_price)
+                console.log(basePrice)
+                console.log(this.keepTwoDecimal(basePrice))
+                console.log(this.keepTwoDecimal(((parseFloat(this.baseInfoForm.waterBase) - _waterMin) / 0.5) * _list[k]
+                  .betweenPrice))
+                _price = basePrice + (parseFloat(this.baseInfoForm.waterBase) - _waterMin) / 0.5 * _list[k]
+                  .betweenPrice;
+                console.log(_price)
+                prcieList.push(this.keepTwoDecimal(_price))
               } else if (_waterMin >= _list[k].priceStart && _waterMin < _list[k].priceEnd) {
                 // 当前段价格+其他段价格
-                let _otherPice = this.getOtherPrice(_list[k])
+                let _otherPice = this.getOtherPrice(_list, _list[k], "leftBasic")
                 let _price1 = (_list[k].priceEnd - _waterMin) / 0.5 * _list[k].betweenPrice + _otherPice;
-
-
-
-                // _price+=_list[k].totalPrice
+                prcieList.push(basePrice + _price1)
 
               }
-
             }
             //基准值
-            else if (_waterMin = parseFloat(this.baseInfoForm.waterBase)) {
-
+            else if (_waterMin == parseFloat(this.baseInfoForm.waterBase)) {
+              prcieList.push(this.keepTwoDecimal(basePrice))
             }
             // 基准右边
             else {
-
+              if (_waterMin > _list[k].priceStart && _waterMin <= _list[k].priceEnd && !this.splitPriceList[i]
+                .haveSplit) {
+                _price = basePrice - (_waterMin - parseFloat(this.baseInfoForm.waterBase)) / 0.5 * _list[k]
+                  .betweenPrice;
+                console.log(_price)
+                prcieList.push(this.keepTwoDecimal(_price))
+              } else if (_waterMin > _list[k].priceStart && _waterMin <= _list[k].priceEnd) {
+                // 当前段价格+其他段价格
+                let _otherPice2 = this.getOtherPrice(_list, _list[k], "rightBasic")
+                let _price2 = (_waterMin - _list[k].priceEnd) / 0.5 * _list[k].betweenPrice + _otherPice2;
+                prcieList.push(basePrice - _price2)
+              }
             }
-
-
           }
         }
         return prcieList
-
       }
-
-
     },
   }
 </script>

+ 4 - 4
src/views/houseSelfCollect/component/routers/route.js

@@ -8,7 +8,7 @@ const houseSelfCollectRouter = {
   alwaysShow: true, // will always show the root menu
   meta: {
     title: 'houseSelfCollect',
-    module: 'contractManagement',
+    module: 'acquisitionManagement',
     icon: '-hetongguanli'
   },
   children: [
@@ -65,7 +65,7 @@ const houseSelfCollectRouter = {
       meta: {
         title: 'acquisitionManagement',
         shortcutEntrance: 'houseSelfCollect',
-        module: 'procurement.procurementOrder.delete',
+        module: 'acquisitionManagement.acquisition.view',
         permissicon: [],
         keepAlive: true
       }
@@ -79,7 +79,7 @@ const houseSelfCollectRouter = {
       meta: {
         title: 'acquisitionManagementAdd',
         shortcutEntrance: 'houseSelfCollect',
-        module: 'procurement.procurementOrder.delete',
+        module: 'acquisitionManagement.acquisition.add',
         permissicon: [],
         keepAlive: true
       },
@@ -122,7 +122,7 @@ const houseSelfCollectRouter = {
       meta: {
         title: 'paymentManagement',
         shortcutEntrance: 'houseSelfCollect',
-        module: 'procurement.procurementOrder.delete',
+        module: 'acquisitionManagement.acquisitionPay',
         permissicon: [],
         keepAlive: true
       }

+ 172 - 17
src/views/houseSelfCollect/paymentManagement.vue

@@ -9,7 +9,6 @@
         <ws-button type="primary" @click="reject">驳回</ws-button>
         <ws-button type="primary" @click="adopt">通过</ws-button>
         <ws-button type="primary" @click="payment">付款</ws-button>
-        <ws-button type="primary" @click="examine">审核</ws-button>
       </template>
       <template slot="right">
         <el-select v-model="warehouseNameKey" placeholder="请选择" @change="warehouseChange">
@@ -142,10 +141,10 @@
         width="350"
       >
       <template scope="scope">
-        <el-button type="danger" v-if='!scope.row.approveStatus' @click="del(scope.row)">删除</el-button>
-        <el-button v-if='!scope.row.approveStatus' @click="settlement(1,scope.row)">结算</el-button>
-        <el-button v-if='scope.row.approveStatus' @click="settlement(2,scope.row)">查看</el-button>
-        <el-button v-if='scope.row.approveStatus' @click='print(scope.row)'>打印</el-button>
+        <el-button type="danger" v-if='!scope.row.approveStatus&&scope.row.status!="已驳回"' @click="del(scope.row)">删除</el-button>
+        <el-button v-if='!scope.row.approveStatus&&scope.row.status!="已驳回"' @click="settlement(1,scope.row)">结算</el-button>
+        <el-button v-if='scope.row.approveStatus||scope.row.status=="已驳回"' @click="settlement(2,scope.row)">查看</el-button>
+        <el-button v-if='scope.row.approveStatus||scope.row.status=="已驳回"' @click='print(scope.row)'>打印</el-button>
       </template>
       </el-table-column>
     </el-table>
@@ -189,13 +188,100 @@
       :total="deptBudgetTotal"
     >
     </el-pagination>
+    <el-dialog
+      width="70%"
+      class="table-content"
+      center
+      :visible.sync="isShowPrint"
+      title="粮食质检单"
+    >
+    <div>
+      <div class="title">中天昊元粮食贸易有限公司结算凭证</div>
+      <table class="table">
+        <tr class="row">
+          <td rowspan="4" class="col col-bgc">买方</td>
+          <td class="col col-bgc">收货单位</td>
+          <td class="col" colspan="2">{{ printData.receivingUnit }}</td>
+          <td rowspan="4" class="col col-bgc">买方</td>
+          <td class="col col-bgc">收货单位</td>
+          <td class="col" colspan="2">{{ printData.receivingUnit }}</td>
+        </tr>
+        <tr class="row">
+          <td class="col col-bgc">收货单位</td>
+          <td class="col" colspan="2">{{ printData.receivingUnit }}</td>
+          <td class="col col-bgc">联系人</td>
+          <td class="col" colspan="2">{{ printData.contacts }}</td>
+        </tr>
+        <tr class="row">
+          <td class="col col-bgc">收货单位</td>
+          <td class="col" colspan="2">{{ printData.receivingUnit }}</td>
+          <td class="col col-bgc">联系人</td>
+          <td class="col" colspan="2">{{ printData.contacts }}</td>
+        </tr>
+        <tr class="row">
+          <td class="col col-bgc">收货单位</td>
+          <td class="col" colspan="2">{{ printData.receivingUnit }}</td>
+          <td class="col col-bgc">联系人</td>
+          <td class="col" colspan="2">{{ printData.contacts }}</td>
+        </tr>
+        <tr class="row">
+          <td class="col col-bgc">货名</td>
+          <td class="col">{{ printData.goodsName }}</td>
+          <td class="col col-bgc">类型</td>
+          <td class="col">{{ printData.customerName }}</td>
+          <td class="col col-bgc">容量(克/升)</td>
+          <td class="col">{{ printData.bulkDensity }}</td>
+          <td class="col col-bgc">不完整粒(%)</td>
+          <td class="col">{{ printData.imperfectGrain }}</td>
+        </tr>
+        <tr class="row">
+          <td class="col col-bgc">等级</td>
+          <td class="col">{{ printData.grade }}</td>
+          <td class="col col-bgc">水分(%)</td>
+          <td class="col">{{ printData.waterContent }}</td>
+          <td class="col col-bgc">热损伤(%)</td>
+          <td class="col">{{ printData.jiaorenli }}</td>
+          <td class="col col-bgc">单价(元/公斤)</td>
+          <td class="col">{{ printData.tidalGrainPrice }}</td>
+        </tr>
+        <tr class="row">
+          <td class="col col-bgc">杂质(%)</td>
+          <td class="col">{{ printData.impurity }}</td>
+          <td class="col col-bgc">霉变粒(%)</td>
+          <td class="col">{{ printData.mildewGrain }}</td>
+          <td class="col col-bgc" colspan="2">购粮性质</td>
+          <td class="col" colspan="2">{{ printData.customerName }}</td>
+        </tr>
+      </table>
+    </div>
+      
+      <div class="bottom">
+        <div class="bottom-row1">
+          <div>质检:{{ printData.qualityInspector }}</div>
+          <div>{{ printData.qualityDate }}</div>
+        </div>
+        <div class="bottom-row2">
+          <div class="left">
+            <img src="../../../public/img/add.png" alt="" />
+          </div>
+          <div class="config">收货单位签名或盖章</div>
+          <div class="">客户签名</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>
+    </el-dialog>
     </div>
   </div>
 </template>
 <script>
-import {getpayment,selectWarehouseSelf,delpayment} from '@/model/houseSelfCollect/index'
+import {getpayment,selectWarehouseSelf,delpayment,auditpayment,getpaymentexamine} from '@/model/houseSelfCollect/index'
 import houseSelfCollectPrint from './houseSelfCollectPrint.vue'
-
+import { posthandle } from '@/model/purchasingManagement/index'
 export default {
   components: {
     houseSelfCollectPrint,
@@ -217,6 +303,8 @@ export default {
       warehouseList:[],
       warehouseNameKey:'',
       warehouseName:'',
+      isShowPrint: false,
+      printData:{},
       warehouse:[],
       value1: '', //付款日期
       modification: [],
@@ -234,8 +322,9 @@ export default {
           this.warehouseList = response
           this.warehouseNameKey = this.warehouseList[0].id
           this.warehouseName = this.warehouseList[0].warehouseName
+          this.getList()
         })
-    this.getList()
+    
   },
   methods: {
    getList(){
@@ -307,23 +396,61 @@ export default {
       if (this.modification.length == 0) {
         this.$message.warning('请选择要驳回的条目')
       } else {
-        this.$confirm('驳回后任务将退回到统计,是否确定驳回?', '提示', {
+        this.$confirm('是否确定驳回?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning',
         })
-          .then(() => {})
+          .then(() => {
+            this.audit(this.modification[0], 0,false,'','') 
+          })
           .catch(() => {
             return false
           })
       }
     },
+    audit(item, index, status, status2, reason) {
+      if (index < this.modification.length) {
+        if(status==true&&item.status=='已驳回'){
+          console.log(11111)
+          auditpayment({compId:sessionStorage.getItem('ws-pf_compId'),id:item.id}).toPromise()
+          .then((response) => {
+            console.log(22222)
+            this.audit(this.modification[index + 1], index + 1, status,status2,reason)
+          })
+        }else{
+        posthandle({
+          taskId: item.taskId,
+          approved: status,
+          auditMind: reason != undefined ? '已驳回' : '34',
+          needReapply: status2 != undefined ? true : false,
+        })
+          .toPromise()
+          .then((response) => {
+            this.audit(this.modification[index + 1], index + 1, status,status2,reason)
+          })
+          .catch((req) => {
+            this.$message.warning(req.message)
+          })
+        }
+        
+      } else {
+        if (status==true) {
+          this.$message.success('通过成功')
+          this.getList()
+        } else if (status==false) {
+          this.$message.success('驳回成功')
+          this.getList()
+          }
+      }
+    },
     adopt() {
+      var that =this
       if (this.modification.length == 0) {
         this.$message.warning('请选择要通过的条目')
       } else {
         this.$confirm(
-          '审核通过后,任务将发送给决策人,是否确定通过?',
+          '是否确定通过?',
           '提示',
           {
             confirmButtonText: '确定',
@@ -331,15 +458,22 @@ export default {
             type: 'warning',
           }
         )
-          .then(() => {})
+          .then(() => {
+            this.audit(this.modification[0], 0, true) 
+          })
           .catch(() => {
             return false
           })
       }
     },
-    print(index,row) {debugger
+    print(row) {
+      getpaymentexamine({id:row.id}).toPromise().then((response) => {
+          this.isShowPrint = true
+          this.printData =response
+        })
+      
       // 打印价格对照表
-        window.location.href="../../../static/payprint.html?data="+JSON.stringify(row)
+        // window.location.href="../../../static/payprint.html?data="+JSON.stringify(row)
       },
     examine() {
       if (this.modification.length == 0) {
@@ -368,16 +502,18 @@ export default {
     // },
     selectInit(row) {
       //在这里一定要记得类型匹配的上。
-      if (row.approveStatus == null) {
-        return true
-      } else if (row.approveStatus != null) {
+      if(row.status!='已驳回'){
         if (row.taskId == null) {
           return false
         } else {
           return true
         }
+      }else{
+        return true
       }
+        
     },
+     
     handleSelectionChange(val) {
       this.modification = val
     },
@@ -436,6 +572,21 @@ export default {
   font-size: 16px;
   font-weight: 600;
 }
+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;
+}
 .formItem {
   width: 70% !important;
 }
@@ -446,5 +597,9 @@ export default {
 /deep/.el-table--enable-row-transition .el-table__body td {
   text-align: center;
 }
+.title{
+  padding:10px;
+  text-align:center;
+}
 </style>