mxx 3 년 전
부모
커밋
3f3a625156
2개의 변경된 파일597개의 추가작업 그리고 135개의 파일을 삭제
  1. 158 66
      src/views/houseSelfCollect/acquisitionManagement.vue
  2. 439 69
      src/views/houseSelfCollect/acquisitionManagementAdd.vue

+ 158 - 66
src/views/houseSelfCollect/acquisitionManagement.vue

@@ -3,16 +3,16 @@
   <div class="content">
     <div class="header">
       <div>
-        <el-select v-model="value" placeholder="请选择">
-          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+        <el-select v-model="selectVal" placeholder="请选择" @change="warehouseChange">
+          <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">允许手动编辑重量</el-checkbox>
       </div>
-      <el-button type="primary" @click="newAcquisition()">新增</el-button>
+      <el-button type="primary" @click="newAcquisition('','','新增')">新增</el-button>
     </div>
     <el-dialog title="新增" :visible.sync="newAcquisitionDialogVisible" width="50%">
-     <acquisitionManagementAdd></acquisitionManagementAdd>
+      <acquisitionManagementAdd></acquisitionManagementAdd>
     </el-dialog>
     <div class="table-content">
       <el-table :data="tableData" style="width: 100%">
@@ -22,28 +22,32 @@
             <span v-else>{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="仓库名称"></el-table-column>
-        <el-table-column prop="contractNo" label="货名"></el-table-column>
-        <el-table-column label="水分范围(%)"></el-table-column>
-        <el-table-column label="基准水分(%)"></el-table-column>
-        <el-table-column label="扣重比"></el-table-column>
-        <el-table-column label="销量上线"></el-table-column>
-        <el-table-column label="状态"></el-table-column>
-        <el-table-column label="扣重比"></el-table-column>
-        <el-table-column label="通过时间"></el-table-column>
+        <el-table-column prop="warehouseName" label="仓库名称"></el-table-column>
+        <el-table-column prop="goodsName" label="货名"></el-table-column>
+        <el-table-column label="水分范围(%)">
+          <template slot-scope="{ row }">
+            {{row.waterMin}}-{{row.waterMax}}
+          </template>
+        </el-table-column>
+        <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="status" label="状态"></el-table-column>
+        <el-table-column prop="passDate" label="通过时间"></el-table-column>
         <el-table-column label="操作" width="300">
           <template slot-scope="scope">
-            <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">查看</el-button>
-            <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-            <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
-            <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">打印</el-button>
+            <el-button size="mini" @click="newAcquisition(scope.$index, scope.row,'查看')">查看</el-button>
+            <el-button size="mini" @click="newAcquisition(scope.$index, scope.row,'编辑')">编辑</el-button>
+            <el-button size="mini" type="danger" @click="delRow(scope.$index, scope.row)">删除</el-button>
+            <el-button size="mini" @click="print(scope.$index, scope.row)">打印</el-button>
           </template>
         </el-table-column>
       </el-table>
-      <el-popover
-        placement="center"
-        width="160"
-        v-model="visible">
+      <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>
+      <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>
@@ -54,7 +58,11 @@
   </div>
 </template>
 <script>
-  // import { getList,} from '@/model/houseSelfCollect/index'
+  import {
+    getPurchasePrice,
+    selectWarehouseSelf,
+    purchasePriceAllowEdit
+  } from '@/model/houseSelfCollect/index'
   import acquisitionManagementAdd from './acquisitionManagementAdd.vue'
   export default {
 
@@ -66,74 +74,158 @@
     },
     data() {
       return {
-        newAcquisitionDialogVisible:false,
-         visible: false,
+        newAcquisitionDialogVisible: false,
+        visible: false,
         checked: false,
-        tableData: [{
-          date: '2016-05-02',
-          name: '王小虎',
-          address: '上海市普陀区金沙江路 1518 弄'
-        }, {
-          date: '2016-05-04',
-          name: '王小虎',
-          address: '上海市普陀区金沙江路 1517 弄'
-        }, {
-          date: '2016-05-01',
-          name: '王小虎',
-          address: '上海市普陀区金沙江路 1519 弄'
-        }, {
-          date: '2016-05-03',
-          name: '王小虎',
-          address: '上海市普陀区金沙江路 1516 弄'
-        }],
-        options: [{
-          value: '选项1',
-          label: '黄金糕'
-        }, {
-          value: '选项2',
-          label: '双皮奶'
-        }, {
-          value: '选项3',
-          label: '蚵仔煎'
-        }, {
-          value: '选项4',
-          label: '龙须面'
-        }, {
-          value: '选项5',
-          label: '北京烤鸭'
-        }],
-        value: ''
+        currentPage: 1,
+        pageSize: 10,
+        deptBudgetTotal: 0,
+        deptCircularPage: {},
+        compId: '',
+        accountName: '',
+        tableData: [],
+        // tableData: [{
+        //   date: '2016-05-02',
+        //   name: '王小虎',
+        //   address: '上海市普陀区金沙江路 1518 弄'
+        // }, {
+        //   date: '2016-05-04',
+        //   name: '王小虎',
+        //   address: '上海市普陀区金沙江路 1517 弄'
+        // }, {
+        //   date: '2016-05-01',
+        //   name: '王小虎',
+        //   address: '上海市普陀区金沙江路 1519 弄'
+        // }, {
+        //   date: '2016-05-03',
+        //   name: '王小虎',
+        //   address: '上海市普陀区金沙江路 1516 弄'
+        // }],
+        warehouseList: [],
+        // warehouseList: [{
+        //   value: '选项1',
+        //   label: '黄金糕'
+        // }, {
+        //   value: '选项2',
+        //   label: '双皮奶'
+        // }, {
+        //   value: '选项3',
+        //   label: '蚵仔煎'
+        // }, {
+        //   value: '选项4',
+        //   label: '龙须面'
+        // }, {
+        //   value: '选项5',
+        //   label: '北京烤鸭'
+        // }],
+        selectVal: ''
       }
     },
     activated() {
-
+      this.getList()
     },
+    computed() {},
     created() {
-      this.value = this.options[0].value
+      debugger
+      //获取公司id
+      this.compId = sessionStorage.getItem('ws-pf_compId')
+      //用户名
+      this.accountName = sessionStorage.getItem('ws-pf_staffName')
+      this.getWarehouseSelf()
+
     },
     methods: {
-      newAcquisition(){
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`)
+        this.pageSize = val
+        this.getList()
+      },
+      handleCurrentChange(val) {
+        this.currentPage = val
+        console.log(`当前页: ${val}`)
+        this.getList()
+      },
+      warehouseChange(e) {
+        console.log(e)
+      },
+      newAcquisition(index, row, type) {
+        debugger
+          let _obj = {}
+          let _query = {}
+        switch (type) {
+          case '新增':
+            _obj = this.warehouseList.find((item) => {
+              return item.id === this.selectVal;
+            });
+            console.log(_obj)
+            _query = {
+            warehouseId: _obj.id,
+            warehouseName: _obj.warehouseName,
+            compId: this.compId,
+            type:type
+          }
+            break
+          case '编辑':
+            break
+          case "查看":
+          _query = {
+            data:row,
+            type:type
+          }
+            break
+          default:
+            break
+        }
         this.$router.push({
-          name: 'acquisitionManagementAdd'
-          // query: { id: row.id },
+          name: 'acquisitionManagementAdd',
+          query: _query
         })
+      },
+      //获取仓库
+      getWarehouseSelf() {
+        selectWarehouseSelf({
+          compId: this.compId,
+          personCharge: this.accountName,
+        }).toPromise().then((response) => {
+          console.log(response)
+          this.warehouseList = response
+          this.selectVal = this.warehouseList[0].id
+          // this.tableData = response.records
 
+        })
+      },
+      //获取列表数据
+      getList() {
+        getPurchasePrice({
+          currentPage: this.currentPage,
+          pageSize: this.pageSize,
+          warehouseId: this.selectVal,
+          compId: this.compId,
+        }).toPromise().then((response) => {
+          console.log(response)
+          this.tableData = response.records
+        })
       },
       allowEdit(val) {
         console.log(val)
+        purchasePriceAllowEdit({}).toPromise().then((response) => {
+          console.log(response)
+          // this.tableData = response.records
+        })
       },
       handleEdit(index, row) {
         console.log(index, row);
       },
-      handleDelete(index, row) {
+      delRow(index, row) {
         this.visible = true
         console.log(index, row);
-      }
+      },
+      print() {}
     },
   }
 </script>
 <style lang="scss" scoped>
-  .header{
+  .header {
     display: flex;
     justify-content: space-between;
     align-items: center;

+ 439 - 69
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -1,46 +1,47 @@
-<!--收购管理新增-->
+<!-- <!--收购管理新增-->
 <template>
   <el-container class="container">
+    <div class="type">{{type}}</div>
     <el-header class="header">
       <img class="head-icon" src="../../../public/img/icons/acquisition6.png" alt="">
-      <div class="head-title">鲅鱼圈一号库</div>
+      <div class="head-title">{{baseInfoForm.warehouseName}}</div>
     </el-header>
-    <el-main>
-      <el-form ref="form" label-position="left" :model="form" label-width="120px">
+    <el-main v-show="isCountShow">
+      <el-form ref="baseInfoForm" label-position="left" :model="baseInfoForm" label-width="120px">
         <el-row class="base-info">
           基本信息
         </el-row>
         <div class="row1">
           <div class="grid-content">
             <el-form-item label="货名">
-              <el-input v-model="form.name"></el-input>
+              <el-input v-model="baseInfoForm.goodsName"></el-input>
             </el-form-item>
           </div>
           <div class="grid-content">
             <el-form-item label="基准水分(%)">
-              <el-input v-model="form.name"></el-input>
+              <el-input v-model="baseInfoForm.waterBase" @input="changeBaseWater"></el-input>
             </el-form-item>
           </div>
           <div class="grid-content">
             <el-form-item label="扣重比">
-              <el-input v-model="form.name"></el-input>
+              <el-input v-model="baseInfoForm.deductWeight"></el-input>
             </el-form-item>
           </div>
         </div>
         <div class="row2">
           <div class="grid-content">
             <el-form-item label="干粮水分">
-              <el-input v-model="form.name"></el-input>
+              <el-input v-model="baseInfoForm.waterMin" @input="changeMinWater"></el-input>
             </el-form-item>
           </div>
           <div class="grid-content">
             <el-form-item label="水分上限">
-              <el-input v-model="form.name"></el-input>
+              <el-input v-model="baseInfoForm.waterMax" @input="changeMaxWater"></el-input>
             </el-form-item>
           </div>
           <div class="grid-content">
             <el-form-item label="销售上限(年/吨)">
-              <el-input v-model="form.name"></el-input>
+              <el-input v-model="baseInfoForm.saleLimit"></el-input>
             </el-form-item>
           </div>
         </div>
@@ -54,12 +55,13 @@
           <div class="top">
             <div class="left">
               <div class="text">基准单价(元/公斤)</div>
-              <el-input v-model="priceList.name"></el-input>
+              <el-input v-model="item.basicUnitPrice"></el-input>
             </div>
             <el-button @click="delSetPrice(item,index)">删除</el-button>
           </div>
+          {{item}}
           <div class="level">
-            <el-checkbox-group v-model="checkList" @change="changeLevel">
+            <el-checkbox-group v-model="item.checkList" @change="changeLevel($event,index)">
               <el-checkbox label="一等"></el-checkbox>
               <el-checkbox label="二等"></el-checkbox>
               <el-checkbox label="三等"></el-checkbox>
@@ -84,7 +86,14 @@
                       v-show="item1.type!=1&&item1.type!=2&&item1.type!=3">-</span>
                   </div>
                   <div v-show="item1.type!=4">
-                    <input class="water-price" v-model="form.name" :disabled="item1.isWrite?false:true"></input>
+                    <input v-if='item1.type==1' class="water-price" v-model="baseInfoForm.waterMin"
+                      :disabled="item1.isWrite?false:true"></input>
+                    <input v-if='item1.type==2' class="water-price" v-model="baseInfoForm.waterBase"
+                      :disabled="item1.isWrite?false:true"></input>
+                    <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>
                   </div>
                   <div class="circle" v-if="item1.type!=4"></div>
                 </div>
@@ -95,14 +104,38 @@
             </div>
           </div>
         </div>
-      </el-row>
 
+        <el-button class="submit" @click="submit">提交</el-button>
+      </el-row>
+    </el-main>
+    <el-main v-show="!isCountShow">
+      <div class="page2-content">
+        <div class="titel">
+          玉米价格对照表(按水分)
+        </div>
+        <el-table :data="tableData" style="width: 100%" :row-class-name="tableRowClassName">
+          <el-table-column prop="waterMin" label="水分下限(%)">
+          </el-table-column>
+          <el-table-column prop="waterMax" label="水分上限(%)">
+          </el-table-column>
+          <el-table-column prop="price1" label="一等单价">
+          </el-table-column>
+          <el-table-column prop="price2" label="二等单价">
+          </el-table-column>
+          <el-table-column prop="price3" label="三等单价">
+          </el-table-column>
+          <el-table-column prop="price4" label="等外单价">
+          </el-table-column>
+        </el-table>
+      </div>
+      <el-button class="submit" @click="closeCount">关闭</el-button>
     </el-main>
   </el-container>
 </template>
 <script>
-  // import { getList,} from '@/model/houseSelfCollect/index'
-
+  import {
+    purchasePriceAdd
+  } from '@/model/houseSelfCollect/index'
   export default {
 
     components: {
@@ -113,49 +146,165 @@
     },
     data() {
       return {
+        tableData: [{
+          waterMin: '10',
+          waterMax: '20',
+          price1: '30',
+          price2: '30',
+          price3: '30',
+          price4: '30',
+        }, {
+          waterMin: '11',
+          waterMax: '20',
+          price1: '30',
+          price2: '30',
+          price3: '30',
+          price4: '30',
+        }, {
+          waterMin: '12',
+          waterMax: '20',
+          price1: '30',
+          price2: '30',
+          price3: '30',
+          price4: '30',
+        }, {
+          waterMin: '13',
+          waterMax: '20',
+          price1: '30',
+          price2: '30',
+          price3: '30',
+          price4: '30',
+        }],
+        isCountShow: true,
         priceList: [{
           unitPrice: '',
           index: 0,
+          checkList: [],
+          basicUnitPrice: "",
           detailList: [{
               type: 1,
               name: "干粮",
-              water: '15',
+              water: "",
               isWrite: false
             },
             {
               type: 4,
-              jfprice: "0.03"
+              jfprice: ""
             },
             {
               type: 2,
               name: "基准",
-              water: '30',
+              water: '',
               isWrite: false
             },
             {
               type: 4,
-              jfprice: "0.03"
+              jfprice: ""
             },
             {
               type: 3,
               name: "上限",
-              water: '40',
+              water: '',
               isWrite: false
             },
           ],
         }],
-        checkList: [],
-        form: {
-          name: "姓名"
+        splitPriceList: [],
+        baseInfoForm: {
+          warehouseId: '',
+          warehouseName: '',
+          compId: '',
+          goodsNameKey: '',
+          goodsName: '',
+          waterBase: '',
+          deductWeight: '',
+          waterMin: '',
+          waterMax: '',
+          saleLimit: '',
+          statusFlag: '',
+          status: '',
+          workflowId: '',
+          approveStatus: '',
+          passDate: '',
+          details: [],
+          detailPrints: []
         },
-
-        index: 0
+        index: 0,
+        type: '',
+        isEdit: true
+      }
+    },
+    created() {
+      debugger
+      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)
+      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
+      switch (this.$route.query.type) {
+        case "新增":
+          break;
+        case "编辑":
+          break;
+        case "查看":
+
+          break;
+        default:
+          break
       }
     },
-    created() {},
+    mounted() {
+      debugger
+
+
+    },
     methods: {
+      changeBaseWater(val) {
+        console.log('val', val)
+        for (let i = 0; i < this.priceList.length; i++) {
+          for (let k = 0; k < this.priceList[i].detailList.length; k++) {
+            if (this.priceList[i].detailList[k].type == 2) {
+              this.priceList[i].detailList[k].water = val
+            }
+          }
+        }
+      },
+      changeMinWater(val) {
+        console.log('val', val)
+        for (let i = 0; i < this.priceList.length; i++) {
+          for (let k = 0; k < this.priceList[i].detailList.length; k++) {
+            if (this.priceList[i].detailList[k].type == 1) {
+              this.priceList[i].detailList[k].water = val
+            }
+          }
+        }
+      },
+      changeMaxWater(val) {
+        console.log('val', val)
+        for (let i = 0; i < this.priceList.length; i++) {
+          for (let k = 0; k < this.priceList[i].detailList.length; k++) {
+            if (this.priceList[i].detailList[k].type == 3) {
+              this.priceList[i].detailList[k].water = val
+            }
+          }
+        }
+      },
+      tableRowClassName({
+        row,
+        rowIndex
+      }) {
+        if (rowIndex === 1) {
+          return 'warning-row';
+        } else if (rowIndex === 3) {
+          return 'success-row';
+        }
+        return '';
+      },
+      // 增加分界
       add(item, item1, index) {
-        debugger
         // let _data = this.detailList;
         if (item.index > 2) {
           this.$message({
@@ -166,24 +315,25 @@
           item.index++
           item.detailList.splice(index + 1, 0, {
             name: "分界",
-            water: '30',
+            water: '',
             type: 5,
             index: 1,
             isWrite: true
-            // jfprice: "0.03"
           });
           item.detailList.splice(index + 1, 0, {
-            jfprice: "0.03",
+            jfprice: "",
             type: 4
           });
           this.makeSpliceIndex(item, item1, index)
         }
       },
+      // 减少分界
       reduce(item, item1, index) {
         item.index--
         item.detailList.splice(index, 2);
         console.log(item, index)
       },
+      // 设置分界索引排序
       makeSpliceIndex(item, item1) {
         let _index = 0
         for (let j = 0; j < item.detailList.length; j++) {
@@ -193,80 +343,268 @@
           }
         }
       },
-      changeLevel() {
-        console.log(this.checkList)
+      // 复选框变化监听
+      changeLevel(val, index) {
+        console.log("val", val)
+        let _data = this.priceList
+        for (let i = 0; i < _data.length; i++) {
+          let _childData = _data[i].checkList
+          for (let k = 0; k < _childData.length; k++) {
+            for (let j = 0; j < val.length; j++) {
+              if (val[j] == _childData[k] && i != index) {
+                _childData.splice(k, 1)
+              }
+            }
+          }
+        }
       },
       newSetPrice() {
         let _newObj = {
           unitPrice: '',
           index: 0,
+          checkList: [],
           detailList: [{
               type: 1,
               name: "干粮",
-              water: '15',
+              water: this.baseInfoForm.waterMin,
               isWrite: false
             },
             {
               type: 4,
-              jfprice: "0.03"
+              jfprice: ""
             },
             {
               type: 2,
               name: "基准",
-              water: '30',
+              water: this.baseInfoForm.waterBase,
               isWrite: false
             },
             {
               type: 4,
-              jfprice: "0.03"
+              jfprice: ""
             },
             {
               type: 3,
               name: "上限",
-              water: '40',
+              water: this.baseInfoForm.waterMax,
               isWrite: false
             },
           ],
         }
         this.priceList.push(_newObj)
       },
-      delSetPrice() {
-        let _newObj = {
-          unitPrice: '',
-          detailList: [{
-              type: 1,
-              name: "干粮",
-              water: '15',
-              isWrite: false
-            },
-            {
-              type: 4,
-              jfprice: "0.03"
-            },
-            {
-              type: 2,
-              name: "基准",
-              water: '30',
-              isWrite: false
-            },
-            {
-              type: 4,
-              jfprice: "0.03"
-            },
-            {
-              type: 3,
-              name: "上限",
-              water: '40',
-              isWrite: false
-            },
-          ],
+      // 删除价格组
+      delSetPrice(item, index) {
+        this.$confirm(
+            '确认删除本组设置?',
+            '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning',
+            }
+          )
+          .then(() => {
+            this.priceList.splice(index, 1)
+          })
+          .catch(() => {
+            return false
+          })
+      },
+      // 提交
+      submit() {
+        debugger
+        this.isCountShow = false
+        for (let k = 0; k < this.priceList.length; k++) {
+          // 新增
+          let _detailsObj = {
+            compId: this.baseInfoForm.warehouseId,
+            basePrice: this.priceList[k].basicUnitPrice,
+            level: '',
+            point: '',
+            pointPrice: ''
+          }
+          for (let j = 0; j < this.priceList[k].checkList.length; j++) {
+            if (j == 0) {
+              _detailsObj.level += this.priceList[k].checkList[j]
+            } else {
+              _detailsObj.level += ',' + this.priceList[k].checkList[j]
+            }
+          }
+          let _index = 0
+          let _index1 = 0
+          for (let i = 0; i < this.priceList[k].detailList.length; i++) {
+            if (this.priceList[k].detailList[i].type == 4) {
+              if (_index == 0) {
+                _index++
+                _detailsObj.pointPrice += this.priceList[k].detailList[i].jfprice
+
+              } else {
+                _detailsObj.pointPrice += ',' + this.priceList[k].detailList[i].jfprice
+              }
+            } else if (_index1 == 0) {
+              _index1++
+              _detailsObj.point += this.priceList[k].detailList[i].water
+            } else {
+              _detailsObj.point += ',' + this.priceList[k].detailList[i].water
+            }
+          }
+
+          debugger
+          this.baseInfoForm.details.push(_detailsObj)
+
+        }
+
+        this.makeTableList()
+        purchasePriceAdd(this.baseInfoForm).toPromise().then((response) => {
+          console.log(response)
+          // this.tableData = response.records
+        })
+      },
+      closeCount() {
+        this.isCountShow = true
+        this.splitPriceList = []
+      },
+      //处理表格数据
+      makeTableList() {
+        // this.tableData
+        //水分下限
+        // this.baseInfoForm.waterMin
+        // 水分上限
+        // this.baseInfoForm.waterMax
+        // price1
+
+        // 获取等级对应分界钱数
+        this.getSplitPrice()
+        // 分界价钱数据
+        // this.splitPriceList
+        let _list = []
+        let _obj = {}
+        let _waterMin = parseFloat(this.baseInfoForm.waterMin)
+        let _waterMax = this.baseInfoForm.waterMax
+        let _count = (_waterMax - _waterMin) / 0.5 + 1
+        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],
+              price4: priceList[3],
+            }
+          } 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],
+              price4: priceList[3],
+            }
+          }
+          _list.push(_obj)
+        }
+        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++) {
+            let _obj = {}
+            _obj.level = _priceList[i].checkList[k]
+            _obj.basicUnitPrice = _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
+              }
+              if (_priceList[i].detailList[j].type != 4 && _priceList[i].detailList[j].type != 3) {
+                _obj.priceList.push({
+                  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)
+                })
+              }
+            }
+            console.log(_obj)
+            this.splitPriceList.push(_obj)
+
+            console.log(this.splitPriceList)
+          }
+        }
+      },
+      getOtherPrice(list) {
+
+      },
+      // 计算价格
+      calculatePrice(_waterMin) {
+        console.log(_waterMin)
+        console.log("this.splitPriceList", this.splitPriceList)
+        let prcieList = []
+        let totalPrice = []
+        let _price = 0
+        for (let i = 0; i < this.splitPriceList.length; i++) {
+          let _list = this.splitPriceList[i].priceList
+          let basePrice = parseFloat(this.splitPriceList[i].basicUnitPrice) * parseFloat(this.baseInfoForm
+            .waterBase) * 0.01
+          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(_price)
+              } else if (_waterMin >= _list[k].priceStart && _waterMin < _list[k].priceEnd) {
+                // 当前段价格+其他段价格
+                let _otherPice = this.getOtherPrice(_list[k])
+                let _price1 = (_list[k].priceEnd - _waterMin) / 0.5 * _list[k].betweenPrice + _otherPice;
+
+
+
+                // _price+=_list[k].totalPrice
+
+              }
+
+            }
+            //基准值
+            else if (_waterMin = parseFloat(this.baseInfoForm.waterBase)) {
+
+            }
+            // 基准右边
+            else {
+
+            }
+
+
+          }
         }
-        // this.detailList.push(_newObj)
+        return prcieList
+
       }
+
+
     },
   }
 </script>
 <style lang="scss">
+  .el-table .warning-row {
+    background: oldlace;
+  }
+
+  .el-table .success-row {
+    background: #f0f9eb;
+  }
+
   .el-checkbox__input.is-checked .el-checkbox__inner,
   .el-checkbox__input.is-indeterminate .el-checkbox__inner {
     background-color: #5878E8;
@@ -492,4 +830,36 @@
       }
     }
   }
+
+  .submit {
+    float: right;
+    width: 74px;
+    height: 32px;
+    background: #5473E8;
+    color: white;
+    border-radius: 4px;
+  }
+
+  .page2-content {
+    border: 1px solid #D8DCE6;
+    margin-top: 20px;
+    padding: 10px;
+    box-sizing: border-box;
+    text-align: center;
+    border-radius: 4px;
+    padding-bottom: 20px;
+  }
+
+  .titel {
+    font-size: 20px;
+    font-weight: 500;
+    color: #323233;
+    margin: 20px;
+  }
+
+  .type {
+    font-size: 16px;
+    font-weight: 500;
+    color: #262626;
+  }
 </style>