gjy 3 éve
szülő
commit
967ccf3f1c

+ 1 - 3
src/api/V2/houseSelfCollect/index.js

@@ -79,6 +79,4 @@ export const API_POST_PAYMENT_PAYMENTSUBMIT = '/paymentManagement/api/payMoney'
 //付款结算修改
 export const API_POST_PAYMENT_SETTLEMENTEDIT = '/paymentManagement/api/editCollect'
 //付款结算修改
-export const API_GET_INSPECT_GETDRYGRAINPRICE = '/purchasePrice/dryGrainPrice'
-
-
+export const API_GET_INSPECT_GETDRYGRAINPRICE = '/purchasePrice/dryGrainPrice'

+ 4 - 0
src/common.js

@@ -0,0 +1,4 @@
+const Warehouse = {payname : ""}
+export default {
+    Warehouse
+}

+ 3 - 0
src/main.js

@@ -18,6 +18,9 @@ Vue.use(AMap);
 
 
 import $ from 'jquery'
+// import Warehouse from './common.js'
+import Warehouse from './common.js'
+Vue.prototype.WAREHOUSE = Warehouse
 // 初始化vue-amap
 AMap.initAMapApiLoader({
   // 高德key

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

@@ -1,6 +1,5 @@
 import { errorCatcher, errorHandle, filter } from 'base-core-lib'
 import { appRx } from '../defalutConfig/indexRx'
-
 import {
   API_GET_CUSTOMER_MANAGE,
   API_POST_CUSTOMER_ADD,

+ 3 - 3
src/views/home/index.vue

@@ -554,17 +554,17 @@ export default {
         // 监听来自串行设备的数据
         while (true) {
           const { value, done } = await this.reader.read();
-          console.log(value,done);
+          // console.log(value,done);
           if (done) {
             // 允许稍后关闭串口。
             this.reader.releaseLock();
             break;
           }
           var result="";
-          if(value.length < 5){
-          }
+          
           for(var i=0;i<value.length;i++){
             result += String.fromCharCode(value[i])
+            console.log(result);
           }
           this.text = result
           // value 是一个 Uint8Array

+ 0 - 2
src/views/home/service.js

@@ -602,8 +602,6 @@ export default {
         isTask: isTask ? 1 : 0
       }
       getRoule().toPromise().then(response => {
-        
-        debugger
         let list = []
         response.forEach(item => {
           if (item.name === 'crewManagement') {

+ 60 - 39
src/views/houseSelfCollect/acquisitionManagement.vue

@@ -1,16 +1,17 @@
 <!--收购管理-->
 <template>
-  <div >
+  <div>
     <BaseHeaderLayout :leftSpan="12">
       <template slot="left">
-        <el-button type="primary" @click="newAcquisition('','','新增')" v-hasPermission=" `acquisitionManagement.acquisitionCustomer.add`">新增</el-button>
-         <div>
-        <el-select v-model="selectVal" placeholder="请选择" @change="warehouseChange" style="margin:0 20px">
-          <el-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName" :value="item.id">
-          </el-option>
-        </el-select>
-        <el-checkbox v-model="checked" @change="allowEdit" :disabled="tableData.length==0">允许手动编辑重量</el-checkbox>
-      </div>
+        <el-button type="primary" @click="newAcquisition('','','新增')"
+          v-hasPermission=" `acquisitionManagement.acquisitionCustomer.add`">新增</el-button>
+        <div>
+          <el-select v-model="selectVal" placeholder="请选择" @change="warehouseChange" style="margin:0 20px">
+            <el-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName" :value="item.id">
+            </el-option>
+          </el-select>
+          <el-checkbox v-model="checked" @change="allowEdit" :disabled="warehouseList.length==0">允许手动编辑重量</el-checkbox>
+        </div>
       </template>
     </BaseHeaderLayout>
     <!-- <div class="header">
@@ -50,18 +51,21 @@
         <el-table-column label="操作" width="300">
           <template slot-scope="scope">
             <el-button size="mini" @click="newAcquisition(scope.$index, scope.row,'查看')">查看</el-button>
-            <el-button v-if="scope.row.status!='审核中'" size="mini" @click="newAcquisition(scope.$index, scope.row,'编辑')" v-hasPermission=" `acquisitionManagement.acquisitionCustomer.edit`">编辑</el-button>
-            <el-button v-if="scope.row.status=='审核中'" size="mini" :disabled="!scope.row.taskId" @click="newAcquisition(scope.$index, scope.row,'审核中')">审核中</el-button>
-            <el-button size="mini" :disabled="!userJurisdiction" type="danger" @click="delRow(scope.$index, scope.row)" v-hasPermission=" `acquisitionManagement.acquisitionCustomer.delete`">删除</el-button>
+            <el-button v-if="scope.row.status!='审核中'" size="mini" @click="newAcquisition(scope.$index, scope.row,'编辑')"
+              v-hasPermission=" `acquisitionManagement.acquisitionCustomer.edit`">编辑</el-button>
+            <el-button v-if="scope.row.status=='审核中'" size="mini" :disabled="!scope.row.taskId"
+              @click="newAcquisition(scope.$index, scope.row,'审核中')">审核中</el-button>
+            <el-button size="mini" :disabled="!userJurisdiction" type="danger" @click="delRow(scope.$index, scope.row)"
+              v-hasPermission=" `acquisitionManagement.acquisitionCustomer.delete`">删除</el-button>
             <el-button size="mini" @click="print(scope.$index, scope.row)">打印</el-button>
           </template>
         </el-table-column>
       </el-table>
-      <div class="paging"> 
-         <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper"
-        :total="deptBudgetTotal">
-      </el-pagination>
+      <div class="paging">
+        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+          :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper"
+          :total="deptBudgetTotal">
+        </el-pagination>
       </div>
     </div>
   </div>
@@ -75,7 +79,9 @@
     purchasePriceDel
   } from '@/model/houseSelfCollect/index'
   import acquisitionManagementAdd from './acquisitionManagementAdd.vue'
-  import { getHp } from '@/utils/getHasPermission'
+  import {
+    getHp
+  } from '@/utils/getHasPermission'
   export default {
     components: {},
     watch: {},
@@ -94,8 +100,9 @@
         selectVal: '',
         goodsNameList: [],
         warehouseList: [],
-        userJurisdiction:false,
-        userJurisdictionAllow:true
+        userJurisdiction: false,
+        userJurisdictionAllow: true,
+        warehouseName:'',
       }
     },
     activated() {
@@ -108,13 +115,12 @@
       this.getUserJurisdiction()
     },
     computed() {},
-    created() {
-    },
+    created() {},
     methods: {
-      getUserJurisdiction(){
-         this.userJurisdiction = getHp('acquisitionManagement.acquisition.view')
-         this.userJurisdictionAllow =  getHp('acquisitionManagement.acquisition.allow')
-         this.userJurisdictionAudit = getHp('acquisitionManagement.acquisition.edit')
+      getUserJurisdiction() {
+        this.userJurisdiction = getHp('acquisitionManagement.acquisition.view')
+        this.userJurisdictionAllow = getHp('acquisitionManagement.acquisition.allow')
+        this.userJurisdictionAudit = getHp('acquisitionManagement.acquisition.edit')
       },
       handleSizeChange(val) {
         console.log(`每页 ${val} 条`)
@@ -127,6 +133,12 @@
         this.getList()
       },
       warehouseChange(e) {
+           for (let i = 0; i < this.warehouseList.length; i++) {
+        if (this.warehouseList[i].id == this.selectVal) {
+          this.warehouseName = this.warehouseList[i].warehouseName
+          this.WAREHOUSE.payname = this.warehouseList[i].id
+        }
+      }
         let _obj = this.warehouseList.find((item) => {
           return item.id === this.selectVal;
         });
@@ -136,8 +148,8 @@
         } else {
           this.checked = false
         }
-  this.currentPage=1
-   this.pageSize = 10
+        this.currentPage = 1
+        this.pageSize = 10
         this.getList()
       },
       newAcquisition(index, row, type) {
@@ -157,11 +169,11 @@
             }
             break
           default:
-          _query = {
-            data: JSON.stringify(row),
-            type: type,
-             goodsNameList: this.goodsNameList
-          }
+            _query = {
+              data: JSON.stringify(row),
+              type: type,
+              goodsNameList: this.goodsNameList
+            }
             break
         }
         this.$router.push({
@@ -178,7 +190,14 @@
           // if(this.userJurisdiction){
           //   this.warehouseList.unshift({warehouseName:response[0].flag})
           // }
+                console.log(this.WAREHOUSE.payname)
           this.selectVal = this.warehouseList[0].id
+          if (this.warehouseName) {
+            this.selectVal = this.WAREHOUSE.payname
+          } else {
+            this.WAREHOUSE.payname = this.warehouseList[0].id
+          }
+          this.warehouseName = this.warehouseList[0].warehouseName
           if (this.warehouseList[0].allowEdit == 1) {
 
             this.checked = true
@@ -191,7 +210,7 @@
       },
       //获取列表数据
       getList() {
-        this.goodsNameList=[]
+        this.goodsNameList = []
         getPurchasePrice({
           currentPage: this.currentPage,
           pageSize: this.pageSize,
@@ -203,7 +222,7 @@
             this.goodsNameList.push(response.records[i].goodsName)
           }
           this.tableData = response.records
-           this.deptBudgetTotal = response.total
+          this.deptBudgetTotal = response.total
         })
       },
       allowEdit(val) {
@@ -249,10 +268,10 @@
           // this.tableData = response.records
           // this.getList()
           localStorage.setItem('pricePrintList', JSON.stringify(response.detailPrints));
-          window.location.href = "../../../static/print.html?name=" + row.goodsName
+          window.open( "../../../static/print.html?name=" + row.goodsName)
         })
       },
-      validate(){
+      validate() {
 
       }
     },
@@ -264,10 +283,12 @@
     justify-content: space-between;
     align-items: center;
   }
-  /deep/.el-table .cell{
+
+  /deep/.el-table .cell {
     text-align: center;
   }
-  .paging{
+
+  .paging {
     text-align: center;
   }
 </style>

+ 193 - 173
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -102,7 +102,7 @@
                     <input v-if='item1.type==3' class="water-price" v-model="baseInfoForm.waterMax"
                       :disabled="item1.isWrite?false:true"></input>
                     <input v-if='item1.type==5' class="water-price" v-model="item1.water"
-                      :disabled="item1.isWrite?false:true"></input>
+                      :disabled="isEdit?false:true"></input>
                   </div>
                   <div class="circle" v-if="item1.type!=4"></div>
                 </div>
@@ -157,7 +157,9 @@
   import {
     packList,
   } from '@/model/contarct/index'
-  import { posthandle } from '@/model/purchasingManagement/index'
+  import {
+    posthandle
+  } from '@/model/purchasingManagement/index'
   export default {
 
     components: {
@@ -168,6 +170,10 @@
     },
     data() {
       return {
+        isShowTip:false,
+        price: 0,
+        left: [],
+        right: [],
         selectVal: "",
         goodnameList: [],
         tableData: [],
@@ -241,8 +247,8 @@
       // 货名
       let _goodsNameList = []
       _goodsNameList = this.$route.query.goodsNameList
-      if(_goodsNameList==undefined){
-        _goodsNameList=[]
+      if (_goodsNameList == undefined) {
+        _goodsNameList = []
       }
       packList({
           constId: 'CON2'
@@ -262,18 +268,18 @@
               }
             }
           }
-          if(_goodsNameList.length==0){
+          if (_goodsNameList.length == 0) {
             this.goodnameList = response
             this.selectVal = response[0].constValue
-          }else{
+          } else {
             this.goodnameList = _list
             this.goodnameList = _list
-            if(_list.length!=0){
-            this.selectVal = _list[0].constValue
+            if (_list.length != 0) {
+              this.selectVal = _list[0].constValue
             }
           }
         })
-        this.isCountShow = true
+      this.isCountShow = true
       switch (this.$route.query.type) {
         case "新增":
           this.submitName = "提交"
@@ -345,11 +351,11 @@
           this.submitName = "提交"
           this.getData()
           break;
-          case "审核中":
-            // this.isEdit = false;
-            this.submitName = "通过"
-            this.getData()
-            break;
+        case "审核中":
+          // this.isEdit = false;
+          this.submitName = "通过"
+          this.getData()
+          break;
         case "查看":
           this.isEdit = false;
           this.submitName = "计算"
@@ -374,8 +380,7 @@
           this.makeLookPriceList()
         })
       },
-      goodsChange(e) {
-      },
+      goodsChange(e) {},
       changeBaseWater(val) {
         for (let i = 0; i < this.priceList.length; i++) {
           for (let k = 0; k < this.priceList[i].detailList.length; k++) {
@@ -504,6 +509,15 @@
         result = Math.round(result * 10000) / 10000;
         return result;
       },
+      //保留两位小数
+      keepOneDecimal(num) {
+        var result = parseFloat(num);
+        if (isNaN(result)) {
+          return false;
+        }
+        result = Math.round(result * 100) / 100;
+        return result;
+      },
       // 添加粮价设置
       newSetPrice() {
         let _newObj = {
@@ -569,7 +583,7 @@
               });
             } else {
               that.priceList.splice(index, 1)
-              that.baseInfoForm.details.split(index,1)
+              that.baseInfoForm.details.split(index, 1)
             }
           })
           .catch(() => {
@@ -728,7 +742,7 @@
             let _item1 = _item.detailList[j]
             if (_item1.type == 4) {
               if (_item1.jfprice == "" || _baseWaterValidate(0, 100, 3, '', 'deductWeight', parseFloat(_item1
-                .jfprice))) {
+                  .jfprice))) {
                 if (_item1.jfprice == "") {
                   this.$message.error('降幅价格不能为空!');
                 } else {
@@ -750,20 +764,21 @@
         }
         return true
       },
-      getEditCheckList(){
-            let _data = this.baseInfoForm.details
-            let _list = []
-          for(let k = 0;k<_data.length;k++){
-            let _list1 = []
-                 _list1 = _data[k].level.split(',')
-                 _list = _list.concat(_list1)
-          }
-         this.checkList = [...new Set(_list)];
-         console.log(this.checkList)
+      getEditCheckList() {
+        let _data = this.baseInfoForm.details
+        let _list = []
+        for (let k = 0; k < _data.length; k++) {
+          let _list1 = []
+          _list1 = _data[k].level.split(',')
+          _list = _list.concat(_list1)
+        }
+        this.checkList = [...new Set(_list)];
+        console.log(this.checkList)
       },
       // 提交
       submit() {
         this.makeTableList()
+        this.baseInfoForm.details = []
         this.makePriceDataList()
         this.baseInfoForm.goodsName = this.selectVal
         let isValidate = false
@@ -781,47 +796,51 @@
             }
             break;
           case "编辑":
-             this.getEditCheckList()
+            this.getEditCheckList()
             isValidate = this.validate()
             if (isValidate) {
               purchasePriceEdit(this.baseInfoForm).toPromise().then((response) => {
                 this.isCountShow = false
               })
             }
-            case "审核中":
-             this.getEditCheckList()
+            break;
+          case "审核中":
+            // this.makePriceDataList()
+            this.getEditCheckList()
             isValidate = this.validate()
             if (isValidate) {
               purchasePriceEdit(this.baseInfoForm).toPromise().then((response) => {
                 let that = this
-                  this.$confirm(`是否确定通过?`, {
-                    cancelButtonText: '取消',
-                    confirmButtonText: '确定',
-                    type: 'warning',
-                  }).then(() => {
-                    //审核
-                    that.audit(this.baseInfoForm,true,2)
-                  })
+                this.$confirm(`是否确定通过?`, {
+                  cancelButtonText: '取消',
+                  confirmButtonText: '确定',
+                  type: 'warning',
+                }).then(() => {
+                  //审核
+                  that.audit(this.baseInfoForm, true, 2)
+                })
               })
             }
             break;
         }
       },
       //审核
-      audit(item,status, status2) {
-          posthandle({
+      audit(item, status, status2) {
+        posthandle({
             taskId: item.taskId,
             approved: status,
             auditMind: '',
             needReapply: status2 != undefined ? true : false,
           })
-            .toPromise()
-            .then((response) => {
-              this.isCountShow = false
-            })
-            .catch((req) => {
-              this.$message.warning(req.message)
-            })
+          .toPromise()
+          .then((response) => {
+            this.isCountShow = false
+            this.isShowTip = true
+             this.getData()
+          })
+          .catch((req) => {
+            this.$message.warning(req.message)
+          })
       },
       // 关闭
       closeCount() {
@@ -839,159 +858,160 @@
         let _list = []
         let _obj = {}
         let _waterMin = parseFloat(this.baseInfoForm.waterMin)
-        let _waterMax = parseFloat(this.baseInfoForm.waterMax)
-        let _count = (_waterMax - _waterMin) / 0.5 + 1
+        let _waterMax = parseFloat(this.baseInfoForm.waterBase)
+        let _count = (_waterMax - _waterMin) / 0.5
         for (let i = 0; i < _count; i++) {
           if (i == 0) {
-            let priceList = this.calculatePrice(_waterMin)
-            _obj = {
-              waterMin: _waterMin,
-              waterMax: _waterMin + 0.4,
-              price1: priceList[0],
-              price2: priceList[1],
-              price3: priceList[2],
-              priceOther: priceList[3],
-            }
+            _waterMax -= 0.1
+          } else {
+            _waterMax -= 0.5
+          }
+          let priceList = this.calculatePrice(_waterMax)
+          _obj = {
+            waterMin: this.keepOneDecimal(_waterMax - 0.4),
+            waterMax: this.keepOneDecimal(_waterMax),
+            price1: this.keepTwoDecimal(priceList[0]),
+            price2: this.keepTwoDecimal(priceList[1]),
+            price3: this.keepTwoDecimal(priceList[2]),
+            priceOther: this.keepTwoDecimal(priceList[3]),
+          }
+          _list.unshift(_obj)
+        }
+        _obj = {}
+        _waterMin = parseFloat(this.baseInfoForm.waterBase)
+        _waterMax = parseFloat(this.baseInfoForm.waterMax)
+        _count = (_waterMax - _waterMin) / 0.5
+        for (let i = 0; i < _count; i++) {
+          if (i == 0) {
+            _waterMin += 0.4
           } else {
             _waterMin += 0.5
-            let priceList = this.calculatePrice(_waterMin)
-            _obj = {
-              waterMin: _waterMin,
-              waterMax: _waterMin + 0.4,
-              price1: priceList[0],
-              price2: priceList[1],
-              price3: priceList[2],
-              priceOther: priceList[3],
-            }
+          }
+          let priceList = this.calculatePriceRight(_waterMin)
+          _obj = {
+            waterMin: this.keepOneDecimal(_waterMin - 0.4),
+            waterMax: this.keepOneDecimal(_waterMin),
+            price1: this.keepTwoDecimal(priceList[0]),
+            price2: this.keepTwoDecimal(priceList[1]),
+            price3: this.keepTwoDecimal(priceList[2]),
+            priceOther: this.keepTwoDecimal(priceList[3]),
           }
           _list.push(_obj)
-          this.baseInfoForm.detailPrints.push(_obj)
+          console.log("_list", _list)
+
         }
+        this.baseInfoForm.detailPrints = _list
         this.tableData = _list
       },
       // 获取分界价格数据,构造分界价格区间数据
-      getSplitPrice() {debugger
-        let _priceList = this.priceList
+      getSplitPrice() {
+        this.left = []
+        this.right = []
+        let _priceList = this.priceList;
         for (let i = 0; i < _priceList.length; i++) {
           for (let k = 0; k < _priceList[i].checkList.length; k++) {
-            let _obj = {}
-            _obj.level = _priceList[i].checkList[k]
-            _obj.basicUnitPrice = parseFloat(_priceList[i].basicUnitPrice)
-            _obj.priceList = []
-            _obj.haveSplit = false
-            for (let j = 0; j < _priceList[i].detailList.length; j++) {
-              if (_priceList[i].detailList[j].type == 5) {
-                _obj.haveSplit = true
+            let _leftObj = {}
+            _leftObj.level = _priceList[i].checkList[k]
+            _leftObj.basicUnitPrice = parseFloat(_priceList[i].basicUnitPrice)
+            _leftObj.priceList = []
+            _leftObj.haveSplit = false
+
+            let _rightObj = {}
+            _rightObj.level = _priceList[i].checkList[k]
+            _rightObj.basicUnitPrice = parseFloat(_priceList[i].basicUnitPrice)
+            _rightObj.priceList = []
+            _rightObj.haveSplit = false
+
+
+            for (let j = (_priceList[i].detailList.length + 1) / 2 - 1; j > 0; j--) {
+              if (_priceList[i].detailList[j] && _priceList[i].detailList[j].type != 4) {
+                if (_priceList[i].detailList[j].type != 1) {
+                  let baseprice = ""
+                  if (j == (_priceList[i].detailList.length + 1) / 2 - 1) {
+                    baseprice = parseFloat(_priceList[i].basicUnitPrice)
+                  } else {
+                    baseprice = parseFloat(_priceList[i].basicUnitPrice + (parseFloat(_priceList[i].detailList[j + 2]
+                      .water) - parseFloat(_priceList[i].detailList[j].water)) / 0.5 * parseFloat(_priceList[i]
+                      .detailList[j + 1].jfprice))
+                  }
+                  _leftObj.priceList.push({
+                    index: j,
+                    priceStart: parseFloat(_priceList[i].detailList[j].water),
+                    priceEnd: parseFloat(_priceList[i].detailList[j - 2].water),
+                    type: parseFloat(_priceList[i].detailList[j].type),
+                    water: _priceList[i].detailList[j].water,
+                    jfprice: parseFloat(_priceList[i].detailList[j - 1].jfprice),
+                    baseprice: baseprice,
+                    price: (parseFloat(_priceList[i].detailList[j].water) - parseFloat(_priceList[i].detailList[j -
+                      2].water)) / 0.5 * parseFloat(_priceList[i].detailList[j - 1].jfprice)
+                  })
+                }
               }
-              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),
-                  betweenPrice: parseFloat(_priceList[i].detailList[j + 1].jfprice),
-                  totalPrice: (parseFloat(_priceList[i].detailList[j + 2].water) - parseFloat(_priceList[i]
-                    .detailList[j].water)) / 0.5 * parseFloat(_priceList[i].detailList[j + 1].jfprice)
-                })
+            }
+            this.left.push(_leftObj)
+            console.log("this.left", this.left)
+            for (let k = (_priceList[i].detailList.length + 1) / 2 - 1; k <= _priceList[i].detailList.length; k++) {
+              if (_priceList[i].detailList[k] && _priceList[i].detailList[k].type != 4) {
+                if (_priceList[i].detailList[k].type != 3) {
+                  let baseprice = ""
+                  if (k == (_priceList[i].detailList.length + 1) / 2 - 1) {
+                    baseprice = parseFloat(_priceList[i].basicUnitPrice)
+                  } else {
+                    baseprice = parseFloat(_priceList[i].basicUnitPrice - (parseFloat(_priceList[i].detailList[k]
+                      .water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.5 * parseFloat(_priceList[i]
+                      .detailList[k - 1].jfprice))
+                  }
+                  _rightObj.priceList.push({
+                    index: k,
+                    priceStart: parseFloat(_priceList[i].detailList[k].water),
+                    priceEnd: parseFloat(_priceList[i].detailList[k + 2].water),
+                    type: parseFloat(_priceList[i].detailList[k].type),
+                    water: _priceList[i].detailList[k].water,
+                    jfprice: parseFloat(_priceList[i].detailList[k + 1].jfprice),
+                    baseprice: baseprice,
+                    price: (parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
+                      k].water)) / 0.5 * parseFloat(_priceList[i].detailList[k + 1].jfprice)
+                  })
+                }
               }
             }
-            this.splitPriceList.push(_obj)
+            this.right.push(_rightObj)
+            console.log("this.right", this.right)
           }
         }
       },
       // 获取当前价格左右价格区间数据
-      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])
+      getOtherPrice(list, water, direction) {},
+      calculatePriceRight(_waterMax) {
+        //获取每个分界值
+        let _listResult = []
+        for (let i = 0; i < this.right.length; i++) {
+          let _list = this.right[i].priceList
+          let tmp = ""
+          for (let k = 0; k < _list.length; k++) {
+            if (_waterMax < _list[k].priceEnd && _waterMax >= _list[k].priceStart) {
+              tmp = parseFloat(_list[k].baseprice - _list[k].jfprice * (((_waterMax - 0.4) - _list[k].priceStart) * 2))
             }
           }
+          _listResult.push(tmp)
         }
-        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
+        return _listResult
       },
       // 计算价格
-      calculatePrice(_waterMin) {debugger
-        let prcieList = []
-        let totalPrice = []
-        let _price = 0
-        for (let i = 0; i < this.splitPriceList.length; i++) {
-          let _list = this.splitPriceList[i].priceList
-          console.log(_list)
-          let basePrice = parseFloat(this.splitPriceList[i].basicUnitPrice)
+      calculatePrice(_waterMax) {
+        let _listResult = []
+        for (let i = 0; i < this.left.length; i++) {
+          let _list = this.left[i].priceList
+          let tmp = ""
           for (let k = 0; k < _list.length; k++) {
-            //基准左边
-            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(this.keepTwoDecimal(_price))
-              } else if (_waterMin >= _list[k].priceStart && _waterMin < _list[k].priceEnd) {
-                // 当前区间段价格+其他区间段价格
-                let _otherPice = this.getOtherPrice(_list, _list[k], "leftBasic")
-                let _price1 = (_list[k].priceEnd - _waterMin) / 0.5 * _list[k].betweenPrice + _otherPice;
-                prcieList.push(basePrice + _price1)
-              }
-            }
-            //基准值
-            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;
-                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)
-              }
+            if (_waterMax >= _list[k].priceEnd && _waterMax < _list[k].priceStart) {
+              tmp = parseFloat(_list[k].baseprice + _list[k].jfprice * ((_list[k].priceStart - (_waterMax + 0.1)) * 2 +
+                1))
             }
           }
+          _listResult.push(tmp)
         }
-        return prcieList
+        return _listResult
       },
       // 构造查看粮价设置数据
       makeLookPriceList() {

+ 1 - 1
src/views/houseSelfCollect/customerManagementAdd.vue

@@ -74,7 +74,7 @@
             <ws-select v-else v-model="customerList.bankDepositBranch" placeholder="请输入开户支行" :disabled="disabled">
               <ws-option v-for="item in bankList" :key="item" :label="item" :value="item" />
             </ws-select>
-            <el-button type="primary" @click="bankInputChange" >{{bankText}}</el-button>
+            <el-button type="primary" @click="bankInputChange" v-if="switchType != 2">{{bankText}}</el-button>
           </ws-form-item>
           <ws-form-item label="收款人姓名" span="1" prop="payeeName">
             <ws-input v-model="customerList.payeeName" placeholder="请输入收款人姓名" maxlength="15" size="small"

+ 96 - 9
src/views/houseSelfCollect/inspectInfo.vue

@@ -34,7 +34,7 @@
               </ws-select>
             </ws-form-item>
             <ws-form-item label="囤位号" span="1" prop="storageTagNo">
-              <ws-input v-model="inspect.storageTagNo" placeholder="请输入囤位号" maxlength="100" size="small"
+              <ws-input v-model="inspect.storageTagNo" placeholder="请输入囤位号" maxlength="15" size="small"
                 :disabled="disabled" />
             </ws-form-item>
             <ws-form-item label="车牌号" span="1" prop="carNumber">
@@ -184,6 +184,7 @@
       if(!this.types){
           this.types = 1
            this.information = '添加'
+           this.disabled = false
            this.inspect = {
           tidalGrainPrice: 0,
           buckleWeightRatio: 0,
@@ -232,7 +233,8 @@
       calculation() {
         let number = '000' + this.count
         number = number.substring(number.length - 4, number.length)
-        this.inspect.qualityNo = 'SGRK' + this.getdate() + this.cangNo + number //SGRK+8位时间+3位仓库编号+4位序列号
+        this.inspect.qualityNo = 'ZCRK' + this.getdate() + this.cangNo + number //SGRK+8位时间+3位仓库编号+4位序列号
+        
         // + this.verifyinit()
       },
       closeDialog() {
@@ -249,7 +251,7 @@
               data: formdata
             }).then((response) => {
               //编辑接口
-              this.inspect.pictureAddress=response.data.url
+              this.inspect.pictureAddress = response.data.url
                getinspectEdit(this.inspect)
                 .toPromise()
                 .then((response) => {
@@ -407,12 +409,41 @@
           })
           return
         }
+        if (String(this.inspect.impurity).indexOf('.') != -1 && String(this.inspect.impurity).length - (String(this.inspect.impurity).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '杂质输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        
+         if (this.inspect.impurity < 0 || this.inspect.impurity > 40) {
+          this.$message({
+            message: '杂质输入错误',
+            type: 'warning',
+          })
+          return
+        }
         if (!this.inspect.waterContent) {
           this.$message({
             message: '水分不能为空',
             type: 'warning',
           })
           return
+        }
+         if (this.inspect.waterContent < 0 || this.inspect.waterContent > 40) {
+          this.$message({
+            message: '水分输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (String(this.inspect.waterContent).indexOf('.') != -1 && String(this.inspect.waterContent).length - (String(this.inspect.waterContent).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '水分输入错误',
+            type: 'warning',
+          })
+          return
         }
         if (!this.inspect.mildewGrain) {
           this.$message({
@@ -420,6 +451,20 @@
             type: 'warning',
           })
           return
+        }
+         if (this.inspect.mildewGrain < 0 || this.inspect.mildewGrain > 40) {
+          this.$message({
+            message: '霉变粒输入错误',
+            type: 'warning',
+          })
+          return
+        }
+         if (String(this.inspect.mildewGrain).indexOf('.') != -1 && String(this.inspect.mildewGrain).length - (String(this.inspect.mildewGrain).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '霉变粒输入错误',
+            type: 'warning',
+          })
+          return
         }
         if (!this.inspect.bulkDensity) {
           this.$message({
@@ -427,6 +472,20 @@
             type: 'warning',
           })
           return
+        }
+         if (this.inspect.bulkDensity < 500 || this.inspect.bulkDensity > 1000) {
+          this.$message({
+            message: '容重输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (String(this.inspect.bulkDensity).indexOf('.') != -1 && String(this.inspect.bulkDensity).length - (String(this.inspect.bulkDensity).indexOf('.') + 1) > 0) {
+          this.$message({
+            message: '容重需输入整数',
+            type: 'warning',
+          })
+          return
         }
         if (!this.inspect.jiaorenli) {
           this.$message({
@@ -434,6 +493,20 @@
             type: 'warning',
           })
           return
+        }
+         if (this.inspect.jiaorenli < 0 || this.inspect.jiaorenli > 40) {
+          this.$message({
+            message: '热损伤输入错误',
+            type: 'warning',
+          })
+          return
+        }
+         if (String(this.inspect.jiaorenli).indexOf('.') != -1 && String(this.inspect.jiaorenli).length - (String(this.inspect.jiaorenli).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '热损伤输入错误',
+            type: 'warning',
+          })
+          return
         }
         if (!this.inspect.imperfectGrain) {
           this.$message({
@@ -442,7 +515,20 @@
           })
           return
         }
-        
+         if (this.inspect.imperfectGrain < 0 || this.inspect.imperfectGrain > 40) {
+          this.$message({
+            message: '不完善粒输入错误',
+            type: 'warning',
+          })
+          return
+        }
+           if (String(this.inspect.imperfectGrain).indexOf('.') != -1 && String(this.inspect.imperfectGrain).length - (String(this.inspect.imperfectGrain).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '不完善粒输入错误',
+            type: 'warning',
+          })
+          return
+        }
         this.inspect.warehouseName = this.warehouseName
         this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
         this.inspect.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
@@ -490,6 +576,7 @@
                     .toPromise()
                     .then((response) => {
                       this.inspect = response
+                      console.log(this.inspect,"cdsklh")
                     })
                   this.isShowPrint = true
                 })
@@ -532,8 +619,8 @@
           .then((response) => {
             for (let i = 0; i < this.purchasePriceList.length; i++) {
               if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-                if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
-                    this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
+                if (this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0) {
+                    this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
                           '提示',
                           {
                             confirmButtonText: '确定',
@@ -592,7 +679,7 @@
           .then((response) => {
                count = response
           })
-        //  客户下拉校验
+        //  货名下拉校验
         getamount({
           compId: sessionStorage.getItem('ws-pf_compId'),
           customerName: this.inspect.customerName,
@@ -602,8 +689,8 @@
           .then((response) => {
             for (let i = 0; i < this.purchasePriceList.length; i++) {
               if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-                if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
-                    this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
+                if (this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0) {
+                    this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
                           '提示',
                           {
                             confirmButtonText: '确定',

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

@@ -189,6 +189,7 @@ export default {
           this.warehouseCount = this.warehouseList[i].count
           this.warehouseNo = this.warehouseList[i].No
           this.cangid = this.warehouseList[i].id
+          this.WAREHOUSE.payname = this.warehouseList[i].value
           this.purchasePriceList = this.warehouseList[i].purchasePriceList
         }
       }
@@ -249,6 +250,11 @@ export default {
           }
           if(this.warehouseList.length > 0){
             this.warehouseName =  this.warehouseList[0].value
+             if (this.cangid) {
+            this.warehouseName = this.WAREHOUSE.payname
+          } else {
+            this.WAREHOUSE.payname = this.warehouseList[0].value
+          }
             this.warehouseCount =  this.warehouseList[0].count
             this.warehouseNo =  this.warehouseList[0].No
             this.cangid =  this.warehouseList[0].id

+ 177 - 188
src/views/houseSelfCollect/paymentManagement.vue

@@ -6,14 +6,15 @@
         <ws-button type="primary" @click="screen(2)">待结算</ws-button>
         <ws-button type="primary" @click="screen()">待审核</ws-button>
         <ws-button type="primary"  @click="screen()">全部</ws-button>
-        <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="reject" v-if="isShowAdopt">驳回</ws-button>
+        <ws-button type="primary" @click="adopt" v-if="isShowAdopt">通过</ws-button>
+        <ws-button type="primary" @click="handlepass" v-if="isShowAdopt">审核</ws-button>
+        <ws-button type="primary" @click="payment" v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">付款</ws-button>
       </template>
       <template slot="right">
         <el-select
           v-model="warehouseNameKey"
-          placeholder="请选择"
+          placeholder="请选择仓库"
           @change="warehouseChange"
           style="margin:0 10px"
         >
@@ -22,8 +23,7 @@
             :key="item.id"
             :label="item.warehouseName"
             :value="item.id"
-          >
-          </el-option>
+          ></el-option>
         </el-select>
         <div></div>
         <ws-input
@@ -34,8 +34,8 @@
           type="input"
         ></ws-input>
         <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
-        <ws-button class="find" type="primary" @click="find()"
-          ><img
+        <ws-button class="find" type="primary" @click="find()">
+          <img
             width="16"
             height="16"
             style="
@@ -44,8 +44,9 @@
               top: 0px;
             "
             src="../../../public/img/sousuo.png"
-            alt=""
-        /></ws-button>
+            alt
+          />
+        </ws-button>
       </template>
     </BaseHeaderLayout>
     <el-table
@@ -56,118 +57,67 @@
       height="780"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column
-        :selectable="selectInit"
-        type="selection"
-        width="55"
-      ></el-table-column>
+      <el-table-column :selectable="selectInit" type="selection" width="55"></el-table-column>
       <el-table-column type="index" label="序号" width="50">
         <template scope="scope">
           <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
           <span v-else>{{ scope.$index + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="paymentNo"
-        width="150"
-        label="编号"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="customerName"
-        label="客户"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="carNo"
-        label="车牌号"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="goodsName"
-        label="货名"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        width="80"
-        prop="type"
-        label="类型"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="tidalGrainPrice"
-        width="140"
-        label="净重单价(元/公斤)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="solidGrainPrice"
-        width="140"
-        label="纯重单价(元/公斤)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="netWeight"
-        width="120"
-        label="净重(公斤)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="pureWeight"
-        width="120"
-        label="纯重(公斤)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="amountIngPayable"
-        label="应付款(元)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="amountEdPayable"
-        label="已付款(元)"
-      ></el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="collectionIngPayable"
-        label="更新时间"
-      ></el-table-column>
+      <el-table-column class="table_td" prop="paymentNo" width="150" label="编号"></el-table-column>
+      <el-table-column class="table_td" prop="customerName" label="客户"></el-table-column>
+      <el-table-column class="table_td" prop="carNo" label="车牌号"></el-table-column>
+      <el-table-column class="table_td" prop="goodsName" label="货名"></el-table-column>
+      <el-table-column class="table_td" width="80" prop="type" label="类型"></el-table-column>
+      <el-table-column class="table_td" prop="tidalGrainPrice" width="140" label="净重单价(元/公斤)"></el-table-column>
+      <el-table-column class="table_td" prop="solidGrainPrice" width="140" label="纯重单价(元/公斤)"></el-table-column>
+      <el-table-column class="table_td" prop="netWeight" width="120" label="净重(公斤)"></el-table-column>
+      <el-table-column class="table_td" prop="pureWeight" width="120" label="纯重(公斤)"></el-table-column>
+      <el-table-column class="table_td" prop="amountIngPayable" label="应付款(元)"></el-table-column>
+      <el-table-column class="table_td" prop="amountEdPayable" label="已付款(元)"></el-table-column>
+      <el-table-column class="table_td" prop="updateDate" label="更新时间" width="140" ></el-table-column>
       <el-table-column class="table_td" prop="status" label="状态">
         <template scope="scope">
-          <span v-if="scope.row.approveStatus">{{
+          <span v-if="scope.row.approveStatus">
+            {{
             scope.row.approveStatus
-          }}</span>
+            }}
+          </span>
           <span v-else>{{ scope.row.status }}</span>
         </template>
       </el-table-column>
-      <el-table-column
-        class="table_td"
-        prop="collectionEdPayable"
-        label="操作"
-        width="350"
-      >
+      <el-table-column class="table_td" prop="collectionEdPayable" label="操作" width="350">
         <template scope="scope">
-          <el-button  type="danger" v-if="!scope.row.approveStatus && scope.row.status != '已驳回'" @click="del(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.delete`">删除</el-button>
-          <el-button v-if="!scope.row.approveStatus && scope.row.status != '已驳回'" @click="settlement(1, scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.add`">结算</el-button >
-          <el-button v-if="scope.row.approveStatus || scope.row.status == '已驳回'" @click="settlement(2, scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.view`">查看</el-button >
-          <el-button v-if=" scope.row.approveStatus || scope.row.status == '已驳回' || userJurisdiction " @click="print(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.print`">打印</el-button>
+          <el-button
+            type="danger"
+            v-if="!scope.row.approveStatus && scope.row.status != '已驳回'"
+            @click="del(scope.row)"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.delete`"
+          >删除</el-button>
+          <el-button
+            v-if="!scope.row.approveStatus && scope.row.status != '已驳回'"
+            @click="settlement(1, scope.row)"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.add`"
+          >结算</el-button>
+          <el-button
+            v-if="scope.row.approveStatus || scope.row.status == '已驳回'"
+            @click="settlement(2, scope.row)"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.view`"
+          >查看</el-button>
+          <el-button
+            v-if=" scope.row.approveStatus || scope.row.status == '已驳回' || userJurisdiction "
+            @click="print(scope.row)"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.print`"
+          >打印</el-button>
         </template>
       </el-table-column>
     </el-table>
     <!-- 付款弹窗 -->
-    <el-dialog
-      width="40%"
-      :visible.sync="paymentForm"
-      :append-to-body="true"
-      title="付款"
-    >
+    <el-dialog width="40%" :visible.sync="paymentForm" :append-to-body="true" title="付款">
       <div class="tanchuang">
         <ws-form>
           <ws-info-table>
-            <ws-form-item label="未付金额(元)" prop="amountNotPayable">
-              {{ payments.amountNotPayable }}
-            </ws-form-item>
+            <ws-form-item label="未付金额(元)" prop="amountNotPayable">{{ payments.amountNotPayable }}</ws-form-item>
             <ws-form-item label="本次付款金额(元)" prop="money">
               <ws-input
                 v-model="payments.money"
@@ -177,15 +127,9 @@
               />
             </ws-form-item>
             <ws-form-item label="付款日期" prop=" paymentDate">
-              <el-date-picker
-                v-model="payments.paymentDate"
-                type="date"
-                placeholder="选择日期"
-              >
-              </el-date-picker>
-            </ws-form-item>
-            <ws-form-item label="上传截图" prop=" paymentScreenshot">
+              <el-date-picker v-model="payments.paymentDate" type="date" placeholder="选择日期"></el-date-picker>
             </ws-form-item>
+            <ws-form-item label="上传截图" prop=" paymentScreenshot"></ws-form-item>
             <div class="upLoad">
               <el-upload
                 class="avatar-uploader"
@@ -213,8 +157,7 @@
         :page-size="deptCircularPage.pageSize"
         layout="total, sizes, prev, pager, next, jumper"
         :total="deptBudgetTotal"
-      >
-      </el-pagination>
+      ></el-pagination>
       <el-dialog
         width="70%"
         class="table-content"
@@ -224,9 +167,7 @@
       >
         <paymentPrint :printData="printData"></paymentPrint>
         <div style="text-align: center">
-          <el-button type="primary" @click="isShowPrint = false"
-            >关闭</el-button
-          >
+          <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>
@@ -241,11 +182,13 @@ import {
   delpayment,
   auditpayment,
   getpaymentexamine,
-  paymentCommit,
+  paymentCommit
 } from '@/model/houseSelfCollect/index'
 import { posthandle } from '@/model/purchasingManagement/index'
 import paymentPrint from './component/paymentPrint.vue'
 import { getHp } from '@/utils/getHasPermission'
+// import Warehouse from './common.js'
+// import Warehouse from '@/main.js'
 export default {
   components: { paymentPrint },
   watch: {},
@@ -258,7 +201,6 @@ export default {
       deptCircularPage: {},
       deptBudgetTotal: 0,
       paymentForm: false,
-      taskTypeList: ['一号库'],
       searchType: '',
       searchTypeText: '',
       searchKeyWord: '',
@@ -273,37 +215,79 @@ export default {
       userJurisdiction: true,
       payments: {
         amountNotPayable: 0,
-        paymentDate:"",
+        paymentDate: ''
       },
+      isShowAdopt:false,
       //上传截图路径
-      imageUrl: '',
+      imageUrl: ''
     }
   },
   activated() {
     this.userJurisdiction = getHp('acquisitionManagement.acquisitionPay.print')
-    selectWarehouseSelf({
-      compId: sessionStorage.getItem('ws-pf_compId'),
-    })
-      .toPromise()
-      .then((response) => {
-        this.warehouseList = response
-        this.warehouseNameKey = this.warehouseList[0].id
-        this.warehouseName = this.warehouseList[0].warehouseName
-        this.getList()
-      })
+    // selectWarehouseSelf({
+    //   compId: sessionStorage.getItem('ws-pf_compId'),
+    // })
+    //   .toPromise()
+    //   .then((response) => {
+
+    //     this.warehouseList = response
+    //     this.warehouseNameKey = this.warehouseList[0].id
+    //     this.warehouseName = this.warehouseList[0].warehouseName
+    //     this.WAREHOUSE.payname = this.warehouseList[0].warehouseName
+    //     this.getList()
+    //   })
+    this.getWarehouse()
+    this.getList()
   },
   methods: {
+    handlepass() {
+      var that = this
+      if (this.modification.length == 0) {
+        this.$message.warning('请选择要通过的条目')
+      } else {
+        this.$confirm(`审核通过后,任务将发送给财务,是否确定通过?`, {
+          cancelButtonText: '取消',
+          confirmButtonText: '确定',
+          type: 'warning',
+        }).then(() => {
+          that.audit(this.modification[0], 0, true, 2)
+        })
+      }
+    },
+    getWarehouse() {
+      selectWarehouseSelf({
+        compId: sessionStorage.getItem('ws-pf_compId')
+      })
+        .toPromise()
+        .then(response => {
+          this.warehouseList = response
+          console.log(this.WAREHOUSE.payname)
+          this.warehouseNameKey = this.warehouseList[0].id
+          if (this.warehouseName) {
+            this.warehouseNameKey = this.WAREHOUSE.payname
+          } else {
+            this.WAREHOUSE.payname = this.warehouseList[0].id
+          }
+
+          // this.getList()
+        })
+    },
     //上传付款截图
     handleAvatarSuccess(e) {
       this.imageUrl = e.url
     },
     printSmall() {
-      window.open('../../../../../static/payprint.html?type=1&dataList=' +JSON.stringify(this.printData))
-        
+      window.open(
+        '../../../../../static/payprint.html?type=1&dataList=' +
+          JSON.stringify(this.printData)
+      )
     },
     printBig() {
-      window.open('../../../../../static/payprint.html?type=2&dataList=' +JSON.stringify(this.printData),"结算凭证")
-        
+      window.open(
+        '../../../../../static/payprint.html?type=2&dataList=' +
+          JSON.stringify(this.printData),
+        '结算凭证'
+      )
     },
     getList() {
       getpayment({
@@ -312,12 +296,29 @@ export default {
         searchKeyWord: this.searchKeyWord,
         searchType: this.searchType,
         warehouseName: this.warehouseName,
+        managementType: 1
+      })
+        .toPromise()
+        .then(response => {
+          this.paymentList = response
+          this.deptBudgetTotal = response.total
+        })
+     getpayment({
+        currentPage: 1,
+        pageSize: 99999,
+        warehouseName: this.warehouseName,
         managementType : 1 
       })
         .toPromise()
         .then((response) => {
-          this.paymentList = response
-           this.deptBudgetTotal = response.total
+          for(let i = 0 ; i < response.length ; i++){
+            if(response[i].taskId){
+              this.isShowAdopt = true
+              return
+            }
+       
+          }
+       
         })
     },
     del(row) {
@@ -327,13 +328,13 @@ export default {
         {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
-          type: 'warning',
+          type: 'warning'
         }
       )
         .then(() => {
           delpayment({ id: row.id })
             .toPromise()
-            .then((response) => {
+            .then(response => {
               this.$message.success('删除成功')
               this.getList()
             })
@@ -342,13 +343,12 @@ export default {
           return false
         })
     },
-    screen(num){
+    screen(num) {
       this.searchType = num
       this.getList()
-
     },
-    find(){
-       this.getList()
+    find() {
+      this.getList()
     },
     settlement(index, row) {
       var data = {}
@@ -366,7 +366,7 @@ export default {
       if (row.goodsName)
         this.$router.push({
           path: 'settlement',
-          query: { type: index, id: row.id, waterMin: data1.waterMin },
+          query: { type: index, id: row.id, waterMin: data1.waterMin }
         })
     },
     payment() {
@@ -387,35 +387,28 @@ export default {
       if (!this.payments.money) {
         this.$message({
           message: '付款金额不能为空',
-          type: 'warning',
+          type: 'warning'
         })
         return
       }
       if (this.payments.money > this.payments.amountNotPayable) {
         this.$message({
           message: '付款金额不能超过未付金额',
-          type: 'warning',
+          type: 'warning'
         })
         return
       }
-      // if(this.payments.money > this.payments.amountNotPayable){
-      //   this.$message({
-      //     message: '付款金额不能超过未付金额',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
       if (!this.payments.paymentDate) {
         this.$message({
           message: '付款日期不能为空',
-          type: 'warning',
+          type: 'warning'
         })
         return
       }
       if (!this.imageUrl) {
         this.$message({
           message: '请上传付款截图 ',
-          type: 'warning',
+          type: 'warning'
         })
         return
       }
@@ -425,21 +418,19 @@ export default {
       this.$confirm('确定提交付款信息?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-        type: 'warning',
+        type: 'warning'
       })
         .then(() => {
           //付款提交
           paymentCommit(this.payments)
             .toPromise()
-            .then((response) => {
+            .then(response => {
               this.$notify.success({
                 title: '成功',
-                message: '付款成功',
+                message: '付款成功'
               })
-               this.paymentForm = false
-               this.getList()
-              // this.paymentList = response
-              // this.$router.go(-1)
+              this.paymentForm = false
+              this.getList()
             })
         })
         .catch(() => {
@@ -453,7 +444,7 @@ export default {
         this.$confirm('是否确定驳回?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
-          type: 'warning',
+          type: 'warning'
         })
           .then(() => {
             this.audit(this.modification[0], 0, false, '', '')
@@ -468,10 +459,10 @@ export default {
         if (status == true && item.status == '已驳回') {
           auditpayment({
             compId: sessionStorage.getItem('ws-pf_compId'),
-            id: item.id,
+            id: item.id
           })
             .toPromise()
-            .then((response) => {
+            .then(response => {
               this.audit(
                 this.modification[index + 1],
                 index + 1,
@@ -485,10 +476,10 @@ export default {
             taskId: item.taskId,
             approved: status,
             auditMind: reason != undefined ? '已驳回' : '34',
-            needReapply: status2 != undefined ? true : false,
+            needReapply: status2 != undefined ? true : false
           })
             .toPromise()
-            .then((response) => {
+            .then(response => {
               this.audit(
                 this.modification[index + 1],
                 index + 1,
@@ -497,7 +488,7 @@ export default {
                 reason
               )
             })
-            .catch((req) => {
+            .catch(req => {
               this.$message.warning(req.message)
             })
         }
@@ -519,7 +510,7 @@ export default {
         this.$confirm('是否确定通过?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
-          type: 'warning',
+          type: 'warning'
         })
           .then(() => {
             this.audit(this.modification[0], 0, true)
@@ -532,13 +523,18 @@ export default {
     print(row) {
       getpaymentexamine({ id: row.id })
         .toPromise()
-        .then((response) => {
+        .then(response => {
           this.isShowPrint = true
           this.printData = response
           let date = new Date()
-           this.printData.currentTime = date.getFullYear() +"年"+ date.getMonth() +"月"+ date.getDay()+"日"
+          this.printData.currentTime =
+            date.getFullYear() +
+            '年' +
+            date.getMonth() +
+            '月' +
+            date.getDay() +
+            '日'
         })
-     
     },
     examine() {
       if (this.modification.length == 0) {
@@ -547,7 +543,7 @@ export default {
         this.$confirm('审核通过后,任务将发送给财务,是否确定通过?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
-          type: 'warning',
+          type: 'warning'
         })
           .then(() => {})
           .catch(() => {
@@ -555,30 +551,22 @@ export default {
           })
       }
     },
-    // print(){
-    //   // 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' })
-    // },
     selectInit(row) {
       //在这里一定要记得类型匹配的上。
       if (row.status != '已驳回') {
-        if (row.taskId == null&&row.status != '已通过'&&row.status!='部分付款') {
+        if (
+          row.taskId == null &&
+          row.status != '已通过' &&
+          row.status != '部分付款'
+        ) {
           return false
         } else {
-           return true
+          return true
         }
-      } 
-      else {
+      } else {
         return true
       }
     },
-
     handleSelectionChange(val) {
       this.modification = val
     },
@@ -586,6 +574,7 @@ export default {
       for (let i = 0; i < this.warehouseList.length; i++) {
         if (this.warehouseList[i].id == this.warehouseNameKey) {
           this.warehouseName = this.warehouseList[i].warehouseName
+          this.WAREHOUSE.payname = this.warehouseList[i].id
         }
       }
       this.getList()
@@ -599,8 +588,8 @@ export default {
       this.currentPage = val
       console.log(`当前页: ${val}`)
       this.getList()
-    },
-  },
+    }
+  }
 }
 </script>
 <style lang="scss" scoped>

+ 3 - 0
src/views/houseSelfCollect/settlement.vue

@@ -77,6 +77,9 @@
              <ws-form-item v-if='paymentList.type=="干粮"' label="干粮单价(元/公斤)" span="1" prop="waterContent">
                 <ws-input v-model="paymentList.qualityInspectionManagement.dryGrainPrice" placeholder="请输入干粮单价" maxlength="100" size="small" disabled />
             </ws-form-item>
+             <ws-form-item v-if='paymentList.type=="干粮"' label="净重(公斤)" span="1" prop="waterContent">
+                <ws-input v-model="paymentList.netWeight" placeholder="请输入干粮单价" maxlength="100" size="small" disabled />
+            </ws-form-item>
           </ws-info-table>
           <div class="titles">质检数据</div>
           <ws-info-table>

+ 9 - 2
src/views/houseSelfCollect/weighingManagement.vue

@@ -70,7 +70,8 @@
       <el-table-column prop="storageNumber" label="囤位号"></el-table-column>
       <el-table-column prop="secretaryWeigher" label="司称员">
        <template slot-scope="scope">
-         {{scope.row.secretaryWeigher}}{{scope.row.skinInspector}}
+         <div v-if="scope.row.secretaryWeigher == scope.row.skinInspector">{{scope.row.skinInspector}}</div>
+         <div v-else>  {{scope.row.secretaryWeigher}}<span v-if="scope.row.skinInspector">,{{scope.row.skinInspector}}</span></div>
        </template> 
       </el-table-column>
       <el-table-column
@@ -197,6 +198,7 @@ export default {
           this.warehouseId = this.warehouseList[i].warehouseId
          this.purchasePriceList = this.warehouseList[i].warehouseList
           this.allowEdit = this.warehouseList[i].allowEdit
+            this.WAREHOUSE.payname = this.warehouseList[i].value
         }
       }
       this.getList()
@@ -250,9 +252,14 @@ export default {
               warehouseList:response[i].purchasePriceList,
               allowEdit:response[i].allowEdit
             })
+          }
+                this.warehouseName =  this.warehouseList[0].value
+             if (this.warehouseId) {
+            this.warehouseName = this.WAREHOUSE.payname
+          } else {
+            this.WAREHOUSE.payname = this.warehouseList[0].value
           }
           this.allowEdit = this.warehouseList[0].allowEdit
-          this.warehouseName = this.warehouseList[0].value
           this.warehouseId = this.warehouseList[0].warehouseId
           this.purchasePriceList = this.warehouseList[0].warehouseList
          this.getList()

+ 3 - 6
src/views/houseSelfCollect/weightCheck.vue

@@ -103,13 +103,9 @@
                 placeholder="未获取到皮重"
                 maxlength="100"
                 size="small"
-                :disabled="disabled"
-              />
+                :disabled="disabled"/>
             </ws-form-item>
-
-            <el-button type="primary" v-if="this.tpyeNo == 2"
-              >重新获取</el-button
-            >
+            <el-button type="primary" v-if="this.tpyeNo == 2">重新获取</el-button>
             <div class="formItem">
               <ws-form-item
                 label="扣杂(公斤)"
@@ -379,6 +375,7 @@ export default {
                   ) {
                     //累计售粮超上限不能完成毛检保存
                     let count = this.purchasePriceList[i].saleLimit - response
+                    console.log(this.weighingList.grossWeight/1000,"毛重转吨")
                     if (count - this.weighingList.grossWeight/1000 < 0) {
                       this.$alert(
                         '该客户累计销售' +

+ 1 - 0
src/views/warehouse/warehouseManagementAdd.vue

@@ -50,6 +50,7 @@
             v-model="deptBudgetList.personCharge"
             placeholder="请选择负责人"
             filterable
+            clearable 
             :filter-method="dataFilter"
             @change="selectstaff"
           >