zxz 2 年之前
父节点
当前提交
34d70a600d

+ 1 - 1
public/static/warehousePrint.html

@@ -216,7 +216,7 @@
           <tr class="row" v-for="(item,index) in printData">
             <td class="col">{{item.inOutDate}}</td>
             <td class="col">{{item.carNo}}</td>
-            <td class="col">{{item.binNumber}}</td>
+            <td class="col">{{item.binNumber.indexOf("托盘")!= -1?item.binNumber.replace("托盘",""):item.binNumber}}</td>
             <td class="col">{{item.boxNo}}</td>
             <td class="col">{{item.boxNo}}</td>
             <td class="col">{{item.grossWeight}}</td>

+ 29 - 9
public/static/weightCheck.html

@@ -179,10 +179,14 @@
                             <td class="col">{{item.goodsName}}</td>
                             <td class="col col-bgc">类型</td>
                             <td class="col">{{item.type}}</td>
-                            <td class="col col-bgc">容量(克/升)</td>
-                            <td class="col">
+                            <td class="col col-bgc" v-if="item.goodsName != '大豆'">容量(克/升)</td>
+                            <td class="col" v-if="item.goodsName != '大豆'">
                                 {{item.qualityInspectionManagement?item.qualityInspectionManagement.bulkDensity:''}}
                             </td>
+                            <td class="col col-bgc" v-if="item.goodsName == '大豆'" >蛋白</td>
+                            <td class="col" v-if="item.goodsName == '大豆'">
+                                {{item.qualityInspectionManagement?item.qualityInspectionManagement.protein:''}}
+                            </td>
                             <td class="col col-bgc">不完善粒(%)</td>
                             <td class="col">
                                 {{item.qualityInspectionManagement?item.qualityInspectionManagement.imperfectGrain:''}}
@@ -217,7 +221,7 @@
                                 {{item.qualityInspectionManagement?item.qualityInspectionManagement.buckleMiscellaneous:''}}
                             </td>
                             <td class="col col-bgc">仓位号</td>
-                            <td class="col">{{item.binNumber}}</td>
+                            <td class="col">{{_item.binNumber.indexOf("托盘") != -1?_item.binNumber.replace("托盘",""):_item.binNumber}}</td>
                         </tr>
                         <tr class="row">
                             <td class="col col-bgc">毛重(公斤)</td>
@@ -294,9 +298,17 @@
                             <td class="col">{{item.goodsName}}</td>
                             <td class="col col-bgc">类型</td>
                             <td class="col">{{item.type}}</td>
-                            <td class="col col-bgc">容量(克/升)</td>
+                            <!-- <td class="col col-bgc">容量(克/升)</td>
                             <td class="col">
                                 {{item.qualityInspectionManagement?item.qualityInspectionManagement.bulkDensity:''}}
+                            </td> -->
+                            <td class="col col-bgc" v-if="item.goodsName != '大豆'">容量(克/升)</td>
+                            <td class="col" v-if="item.goodsName != '大豆'">
+                                {{item.qualityInspectionManagement?item.qualityInspectionManagement.bulkDensity:''}}
+                            </td>
+                            <td class="col col-bgc" v-if="item.goodsName == '大豆'" >蛋白</td>
+                            <td class="col" v-if="item.goodsName == '大豆'">
+                                {{item.qualityInspectionManagement?item.qualityInspectionManagement.protein:''}}
                             </td>
                             <td class="col col-bgc">不完善粒(%)</td>
                             <td class="col">
@@ -332,7 +344,7 @@
                                 {{item.qualityInspectionManagement?item.qualityInspectionManagement.buckleMiscellaneous:''}}
                             </td>
                             <td class="col col-bgc">仓位号</td>
-                            <td class="col">{{item.binNumber}}</td>
+                            <td class="col">{{_item.binNumber.indexOf("托盘") != -1?_item.binNumber.replace("托盘",""):_item.binNumber}}</td>
                         </tr>
                         <tr class="row">
                             <td class="col col-bgc">毛重(公斤)</td>
@@ -409,9 +421,17 @@
                         <td class="col">{{_item.goodsName}}</td>
                         <td class="col col-bgc">类型</td>
                         <td class="col">{{_item.type}}</td>
-                        <td class="col col-bgc">容量(克/升)</td>
+                        <!-- <td class="col col-bgc">容量(克/升)</td>
                         <td class="col">
-                            {{_item.qualityInspectionManagement?_item.qualityInspectionManagement.bulkDensity:''}}</td>
+                            {{_item.qualityInspectionManagement?_item.qualityInspectionManagement.bulkDensity:''}}</td> -->
+                                <td class="col col-bgc" v-if="_item.goodsName != '大豆'">容量(克/升)</td>
+                                <td class="col" v-if="_item.goodsName != '大豆'">
+                                    {{_item.qualityInspectionManagement?_item.qualityInspectionManagement.bulkDensity:''}}
+                                </td>
+                                <td class="col col-bgc" v-if="_item.goodsName == '大豆'" >蛋白</td>
+                                <td class="col" v-if="_item.goodsName == '大豆'">
+                                    {{_item.qualityInspectionManagement?_item.qualityInspectionManagement.protein:''}}
+                                </td>
                         <td class="col col-bgc">不完善粒(%)</td>
                         <td class="col">
                             {{_item.qualityInspectionManagement?_item.qualityInspectionManagement.imperfectGrain:''}}
@@ -443,7 +463,7 @@
                             {{_item.qualityInspectionManagement?_item.qualityInspectionManagement.buckleMiscellaneous:''}}
                         </td>
                         <td class="col col-bgc">仓位号</td>
-                        <td class="col">{{_item.binNumber}}</td>
+                        <td class="col">{{_item.binNumber.indexOf("托盘") != -1?_item.binNumber.replace("托盘",""):_item.binNumber}}</td>
                     </tr>
                     <tr class="row">
                         <td class="col col-bgc">毛重(公斤)</td>
@@ -516,7 +536,7 @@
             </div>
             <div class="small-row">
                 <div>仓位号:</div>
-                <div>{{tableData.binNumber}}</div>
+                <div>{{tableData.binNumber.indexOf("托盘")!= -1?tableData.binNumber.replace("托盘",""):tableData.binNumber}}</div> 
             </div>
             <div class="small-row">
                 <div>收货单位</div>

+ 405 - 161
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -11,8 +11,8 @@
         <el-row class="base-info">
           <el-col :span="2" style="line-height: 32px;">基本信息</el-col>
           <el-col :span="22">
-            <el-button :type="!isSolidFood?'primary':''" @click="typeChange()" v-if="type == '新增'">以水分定价</el-button>
-            <el-button :type="isSolidFood?'primary':''" @click="typeChange(1)" v-if="type == '新增'">以容重定价</el-button>
+            <el-button :type="!isSolidFood ? 'primary' : ''" @click="typeChange()" v-if="type == '新增'">以水分定价</el-button>
+            <el-button :type="isSolidFood ? 'primary' : ''" @click="typeChange(1)" v-if="type == '新增'">以容重定价</el-button>
           </el-col>
         </el-row>
         <div class="row1">
@@ -114,7 +114,8 @@
                   <div class="item-style">
                     <div v-if="item1.type != 4" class="item-style-title">
                       <span>{{ item1.name }}{{ item1.index }}</span>
-                      <el-button class="add" @click="add(item, item1, index)" v-if="item1.type != 3" :disabled="!isEdit">+
+                      <el-button class="add" @click="add(item, item1, index)" v-if="item1.type != 3"
+                        :disabled="!isEdit">+
                       </el-button>
                       <el-button class="reduce" @click="reduce(item, item1, index)"
                         v-show="item1.type != 1 && item1.type != 2 && item1.type != 3" :disabled="!isEdit">-</el-button>
@@ -145,7 +146,8 @@
           <div class="content">
             <div class="count">
               <div class="left" style="align-items: center;justify-content: flex-end;">
-                <div>容重(g/L)</div>
+                <div v-if="this.baseInfoForm.goodsNameKey == 6">蛋白(g/L)</div>
+                <div v-else>容重(g/L)</div>
                 <div>价格(元/公斤)</div>
               </div>
 
@@ -153,7 +155,28 @@
                 <div class="jt-style1"></div>
                 <div class="line1"></div>
 
-                <div v-for="(item1, index) in priceRZObj.detailList" :key="index">
+                <div v-show="baseInfoForm.goodsNameKey == 6" v-for="(item1, index) in priceRZObjDb.detailListDb">
+                  <div class="item-style" v-if="item1.isShow">
+                    <div v-if="item1.type != 4" class="item-style-title">
+                      <span>{{ item1.name }}</span>
+                      <el-button class="add" @click="addDB(item1, index)" v-if="item1.type != 3" :disabled="!isEdit">+
+                      </el-button>
+                      <el-button class="reduce" @click="reduceDB(item1, index)"
+                        v-show="item1.type != 1 && priceRZObjDb.detailListDb.length > 2"
+                        :disabled="!isEdit">-</el-button>
+                    </div>
+                    <div v-show="item1.type != 4">
+                      <input class="water-price" :class="item1.isWrite ? 'white-bgc' : ''"
+                        v-model="item1.weight"></input>
+                    </div>
+                    <div class="circle" v-if="item1.type != 4"></div>
+                  </div>
+                  <div class="bottom-price">
+                    <input v-if="item1.type == 4" class="water-price" :class="isEdit ? 'white-bgc' : ''"
+                      v-model="item1.jfprice" :disabled="!isEdit"></input>
+                  </div>
+                </div>
+                <div v-show="baseInfoForm.goodsNameKey != 6" v-for="(item1, index) in priceRZObj.detailList" :key="index">
                   <div class="item-style" v-if="item1.isShow">
                     <div v-if="item1.type != 4" class="item-style-title">
                       <span>{{ item1.name }}</span>
@@ -163,7 +186,8 @@
                         v-show="item1.type != 1 && priceRZObj.detailList.length > 2" :disabled="!isEdit">-</el-button>
                     </div>
                     <div v-show="item1.type != 4">
-                      <input class="water-price" :class="item1.isWrite ? 'white-bgc' : ''" v-model="item1.weight"></input>
+                      <input class="water-price" :class="item1.isWrite ? 'white-bgc' : ''"
+                        v-model="item1.weight"></input>
                     </div>
                     <div class="circle" v-if="item1.type != 4"></div>
                   </div>
@@ -199,7 +223,7 @@
           </el-table-column>
         </el-table>
       </div>
-      <div class="page2-content" v-else>
+      <div v-else-if="this.baseInfoForm.bulkDensityStandard && this.baseInfoForm.goodsName != '大豆'" class="page2-content">
         <!-- 容重打印 -->
         <div class="titel">
           {{ selectVal }}价格对照表(按容重)
@@ -213,6 +237,20 @@
           </el-table-column>
         </el-table>
       </div>
+      <div v-else class="page2-content">
+        <!-- 容重打印 -->
+        <div class="titel">
+          {{ selectVal }}价格对照表(按蛋白)
+        </div>
+        <el-table :data="tableData1" style="width: 100%" :row-class-name="tableRowClassName">
+          <el-table-column prop="bulkDensityMax" label="蛋白上限">
+          </el-table-column>
+          <el-table-column prop="bulkDensityMin" label="蛋白下限">
+          </el-table-column>
+          <el-table-column prop="bulkDensityPrice" label="蛋白单价">
+          </el-table-column>
+        </el-table>
+      </div>
       <div class="bottom-btn">
         <div v-if="baseInfoForm.status == '审核中'" class="left">当前价格尚未通过审核,建议审核通过后进行打印</div>
         <div class="right">
@@ -276,6 +314,31 @@ export default {
           },
         ],
       },
+      priceRZObjDb: {
+        index: 0,
+        checkList: [],
+        basicUnitPrice: '',
+        detailListDb: [
+          {
+            type: 1,
+            name: '蛋白',
+            weight: '1000',
+            isWrite: false,
+            isShow: false,
+          },
+          {
+            type: 4,
+            jfprice: '',
+          },
+          {
+            type: 1,
+            name: '蛋白',
+            weight: '',
+            isWrite: true,
+            isShow: true,
+          },
+        ],
+      },
       priceList: [
         {
           index: 0,
@@ -331,6 +394,7 @@ export default {
         dryGrainPrice: '',
         details: [],
         detailPrints: [],
+        protein: '',
       },
       index: 0,
       type: '',
@@ -341,6 +405,7 @@ export default {
       checkList2: [],
       checkList3: [],
       checkList4: [],
+      bulkDensityStandard:'',
     }
   },
 
@@ -515,12 +580,14 @@ export default {
     }
   },
   methods: {
-    typeChange(val){
-      if(val == 1){
+    typeChange(val) {
+      if (val == 1) {
         this.isSolidFood = true
+        this.bulkDensityStandard = 1
         this.baseInfoForm.bulkDensityStandard = 1
-      }else{
+      } else {
         this.isSolidFood = false
+        this.bulkDensityStandard = ''
         this.baseInfoForm.bulkDensityStandard = ''
       }
     },
@@ -544,10 +611,10 @@ export default {
           //构造查看priceList数据
           this.priceList = []
           this.makeLookPriceList()
-          if(this.baseInfoForm.bulkDensityStandard == 1){
+          if (this.baseInfoForm.bulkDensityStandard == 1) {
             this.isSolidFood = true
             this.baseInfoForm.bulkDensityStandard = 1
-          }else{
+          } else {
             this.isSolidFood = false
             this.baseInfoForm.bulkDensityStandard = ''
           }
@@ -592,43 +659,44 @@ export default {
     },
     goodsChange(e) {
       this.baseInfoForm = {
-          //防止填完数据  后切换货名不清空多余数据
-          warehouseId: '',
-          warehouseName: '',
-          compId: this.$route.query.compId,
-          goodsNameKey: '',
-          goodsName: '',
-          waterBase: '',
-          deductWeight: '',
-          waterMin: '',
-          waterMax: '',
-          saleLimit: 2000,
-          statusFlag: '',
-          status: '',
-          workflowId: '',
-          approveStatus: '',
-          passDate: '',
-          dryGrainPrice: '',
-          details: [],
-          detailPrints: [],
-          paramType: '2',
-        }
-        this.baseInfoForm.warehouseId = this.$route.query.warehouseId
-        this.baseInfoForm.warehouseName = this.$route.query.warehouseName
-        this.baseInfoForm.compId = this.$route.query.compId
-      if (e == '玉米淀粉' ||
-        e == '玉米(机收)' ||
-        e == '玉米(酒精)' ||
-        e == '玉米(筛漏)' ||
-        e == '玉米(陈粮)' ||
-        e == '玉米(棒)' ||
-        e == '玉米'
-      ) {
-       
-        this.baseInfoForm.bulkDensityStandard = 1
-      }else{
-        this.baseInfoForm.bulkDensityStandard = ''
+        //防止填完数据  后切换货名不清空多余数据
+        warehouseId: '',
+        warehouseName: '',
+        compId: this.$route.query.compId,
+        goodsNameKey: '',
+        goodsName: '',
+        waterBase: '',
+        deductWeight: '',
+        waterMin: '',
+        waterMax: '',
+        saleLimit: 2000,
+        statusFlag: '',
+        status: '',
+        workflowId: '',
+        approveStatus: '',
+        passDate: '',
+        dryGrainPrice: '',
+        details: [],
+        detailPrints: [],
+        paramType: '2',
+        protein: '',
       }
+      this.baseInfoForm.warehouseId = this.$route.query.warehouseId
+      this.baseInfoForm.warehouseName = this.$route.query.warehouseName
+      this.baseInfoForm.compId = this.$route.query.compId
+      this.baseInfoForm.bulkDensityStandard = this.bulkDensityStandard
+      // if (e == '玉米淀粉' ||
+      //   e == '玉米(机收)' ||
+      //   e == '玉米(酒精)' ||
+      //   e == '玉米(筛漏)' ||
+      //   e == '玉米(陈粮)' ||
+      //   e == '玉米(棒)' ||
+      //   e == '玉米'
+      // ) {
+      //   this.baseInfoForm.bulkDensityStandard = 1
+      // } else {
+      //   this.baseInfoForm.bulkDensityStandard = ''
+      // }
       for (let num = 0; num < this.goodnameList.length; num++) {
         if (e == this.goodnameList[num].constValue) {
           this.baseInfoForm.goodsNameKey = this.goodnameList[num].constKey
@@ -705,19 +773,19 @@ export default {
       //     type: 'warning',
       //   })
       // } else {
-        item.index++
-        item.detailList.splice(index + 1, 0, {
-          name: '分界',
-          water: '',
-          type: 5,
-          index: 1,
-          isWrite: true,
-        })
-        item.detailList.splice(index + 1, 0, {
-          jfprice: '',
-          type: 4,
-        })
-        this.makeSpliceIndex(item, item1, index)
+      item.index++
+      item.detailList.splice(index + 1, 0, {
+        name: '分界',
+        water: '',
+        type: 5,
+        index: 1,
+        isWrite: true,
+      })
+      item.detailList.splice(index + 1, 0, {
+        jfprice: '',
+        type: 4,
+      })
+      this.makeSpliceIndex(item, item1, index)
       // }
     },
     // 减少分界
@@ -735,6 +803,22 @@ export default {
         }
       }
     },
+    addDB(item1, index) {
+      this.priceRZObjDb.detailListDb.splice(index + 1, 0, {
+        name: '蛋白',
+        water: '',
+        type: 1,
+        isWrite: true,
+        isShow: true,
+      })
+      this.priceRZObjDb.detailListDb.splice(index + 1, 0, {
+        jfprice: '',
+        type: 4,
+      })
+    },
+    reduceDB(index) {
+      this.priceRZObjDb.detailListDb.splice(index - 1, 2)
+    },
     // 复选框变化监听
     changeLevel(val, index) {
       let _data = this.priceList
@@ -873,38 +957,73 @@ export default {
     //构造新增价格数据
     makePriceDataList() {
       if (this.baseInfoForm.bulkDensityStandard == 1) {
-        //以容重构造数据
-        let _index = 0
-        let _index1 = 0
-        let _detailsObj = {
-          compId: this.baseInfoForm.warehouseId,
-          // basePrice: this.priceList[k].basicUnitPrice,
-          // level: '',
-          point: '',
-          pointPrice: '',
-        }
-        for (let k = 0; k < this.priceRZObj.detailList.length; k++) {
-          // 新增
-          if (this.priceRZObj.detailList[k].type == 4) {
-            //价格
-            if (_index == 0) {
-              _index++
-              _detailsObj.pointPrice += this.priceRZObj.detailList[k].jfprice
+        if (this.baseInfoForm.goodsNameKey == 6) {
+          //以容重构造数据
+          let _index = 0
+          let _index1 = 0
+          let _detailsObj = {
+            compId: this.baseInfoForm.warehouseId,
+            // basePrice: this.priceList[k].basicUnitPrice,
+            // level: '',
+            point: '',
+            pointPrice: '',
+          }
+          for (let k = 0; k < this.priceRZObjDb.detailListDb.length; k++) {
+            // 新增
+            if (this.priceRZObjDb.detailListDb[k].type == 4) {
+              //价格
+              if (_index == 0) {
+                _index++
+                _detailsObj.pointPrice += this.priceRZObjDb.detailListDb[k].jfprice
+              } else {
+                _detailsObj.pointPrice +=
+                  ',' + this.priceRZObjDb.detailListDb[k].jfprice
+              }
             } else {
-              _detailsObj.pointPrice +=
-                ',' + this.priceRZObj.detailList[k].jfprice
+              //容重
+              if (_index1 == 0) {
+                _index1++
+                _detailsObj.point += this.priceRZObjDb.detailListDb[k].weight
+              } else {
+                _detailsObj.point += ',' + this.priceRZObjDb.detailListDb[k].weight
+              }
             }
-          } else {
-            //容重
-            if (_index1 == 0) {
-              _index1++
-              _detailsObj.point += this.priceRZObj.detailList[k].weight
+          }
+          this.baseInfoForm.details.push(_detailsObj)
+        } else {
+          //货名不为大豆时,以容重构造数据
+          let _index = 0
+          let _index1 = 0
+          let _detailsObj = {
+            compId: this.baseInfoForm.warehouseId,
+            // basePrice: this.priceList[k].basicUnitPrice,
+            // level: '',
+            point: '',
+            pointPrice: '',
+          }
+          for (let k = 0; k < this.priceRZObj.detailList.length; k++) {
+            // 新增
+            if (this.priceRZObj.detailList[k].type == 4) {
+              //价格
+              if (_index == 0) {
+                _index++
+                _detailsObj.pointPrice += this.priceRZObj.detailList[k].jfprice
+              } else {
+                _detailsObj.pointPrice +=
+                  ',' + this.priceRZObj.detailList[k].jfprice
+              }
             } else {
-              _detailsObj.point += ',' + this.priceRZObj.detailList[k].weight
+              //容重
+              if (_index1 == 0) {
+                _index1++
+                _detailsObj.point += this.priceRZObj.detailList[k].weight
+              } else {
+                _detailsObj.point += ',' + this.priceRZObj.detailList[k].weight
+              }
             }
           }
+          this.baseInfoForm.details.push(_detailsObj)
         }
-        this.baseInfoForm.details.push(_detailsObj)
       } else {
         //已水分构造数据
         for (let k = 0; k < this.priceList.length; k++) {
@@ -1382,15 +1501,25 @@ export default {
     check() {
       let that = this
       for (let i = 0; i < this.baseInfoForm.detailPrints.length; i++) {
-        if (!this.baseInfoForm.detailPrints[i].bulkDensityMin || !this.baseInfoForm.detailPrints[i].bulkDensityMax || !this.baseInfoForm.detailPrints[i].bulkDensityPrice) {
-          that.$message.error('请输入容重和对应区间价格!')
-          return false
-        }
-
-        if (Number(this.baseInfoForm.detailPrints[i].bulkDensityMin) > Number(this.baseInfoForm.detailPrints[i].bulkDensityMax)) {
-          that.$message.error('请从左到右按大到小填写容重!')
-          return false
-        }
+        // if (this.baseInfoForm.goodsName != '大豆') {
+          if (!this.baseInfoForm.detailPrints[i].bulkDensityMin || !this.baseInfoForm.detailPrints[i].bulkDensityMax || !this.baseInfoForm.detailPrints[i].bulkDensityPrice) {
+            that.$message.error(this.baseInfoForm.goodsName != '大豆' ? '请输入容重和对应区间价格!':'请输入蛋白和对应区间价格!')
+            return false
+          }
+          if (Number(this.baseInfoForm.detailPrints[i].bulkDensityMin) > Number(this.baseInfoForm.detailPrints[i].bulkDensityMax)) {
+            that.$message.error(this.baseInfoForm.goodsName != '大豆' ? '请从左到右按大到小填写容重!':'请输入蛋白和对应区间价格!')
+            return false
+          }
+        // }else{
+        //   if (!this.baseInfoForm.detailPrints[i].bulkDensityMin || !this.baseInfoForm.detailPrints[i].bulkDensityMax || !this.baseInfoForm.detailPrints[i].bulkDensityPrice) {
+        //     that.$message.error('请输入蛋白和对应区间价格!')
+        //     return false
+        //   }
+        //   if (Number(this.baseInfoForm.detailPrints[i].bulkDensityMin) > Number(this.baseInfoForm.detailPrints[i].bulkDensityMax)) {
+        //     that.$message.error('请从左到右按大到小填写蛋白!')
+        //     return false
+        //   }
+        // }
       }
       return true
     },
@@ -1415,7 +1544,43 @@ export default {
     // 关闭
     closeCount() {
       this.isCountShow = true
-      this.splitPriceList = []
+      this.priceRZObjDb.detailListDb =[   {
+            type: 1,
+            name: '蛋白',
+            weight: '1000',
+            isWrite: false,
+            isShow: false,
+          },
+          {
+            type: 4,
+            jfprice: '',
+          },
+          {
+            type: 1,
+            name: '蛋白',
+            weight: '',
+            isWrite: true,
+            isShow: true,
+          },]
+      this.priceRZObj.detailList =[   {
+            type: 1,
+            name: '容重',
+            weight: '1000',
+            isWrite: false,
+            isShow: false,
+          },
+          {
+            type: 4,
+            jfprice: '',
+          },
+          {
+            type: 1,
+            name: '容重',
+            weight: '',
+            isWrite: true,
+            isShow: true,
+          },]
+      // this.baseInfoForm.splitPriceList = []
       this.$router.push({
         name: 'acquisitionManagement',
       })
@@ -1423,48 +1588,93 @@ export default {
     //处理价格表格数据
     makeTableList() {
       if (this.baseInfoForm.bulkDensityStandard == 1) {
-        //以容重构造打印数据
-        let price = []
-        let weight = []
-        let _obj1 = {}
-        let _Lists = []
-        for (let num = 0; num < this.priceRZObj.detailList.length; num++) {
-          if (this.priceRZObj.detailList[num].type == 4) {
-            price.push(this.priceRZObj.detailList[num].jfprice)
-          } else if (this.priceRZObj.detailList[num].type == 1) {
-            weight.push(this.priceRZObj.detailList[num].weight)
+        if (this.baseInfoForm.goodsName != '大豆') {
+          //以容重构造打印数据
+          let price = []
+          let weight = []
+          let _obj1 = {}
+          let _Lists = []
+          for (let num = 0; num < this.priceRZObj.detailList.length; num++) {
+            if (this.priceRZObj.detailList[num].type == 4) {
+              price.push(this.priceRZObj.detailList[num].jfprice)
+            } else if (this.priceRZObj.detailList[num].type == 1) {
+              weight.push(this.priceRZObj.detailList[num].weight)
+            }
           }
-        }
-        for (let val = 0; val < price.length; val++) {
-          if (val == 0) {
-            _obj1 = {
-              bulkDensityMax: weight[val],
-              bulkDensityMin: weight[val + 1],
-              bulkDensityPrice: price[val],
+          for (let val = 0; val < price.length; val++) {
+            if (val == 0) {
+              _obj1 = {
+                bulkDensityMax: weight[val],
+                bulkDensityMin: weight[val + 1],
+                bulkDensityPrice: price[val],
+              }
+            } else {
+              _obj1 = {
+                bulkDensityMax: weight[val] - 1,
+                bulkDensityMin: weight[val + 1],
+                bulkDensityPrice: price[val],
+              }
             }
-          } else {
-            _obj1 = {
-              bulkDensityMax: weight[val] - 1,
-              bulkDensityMin: weight[val + 1],
-              bulkDensityPrice: price[val],
+            _Lists.push(_obj1)
+          }
+          this.baseInfoForm.detailPrints = _Lists
+          this.tableData1 = _Lists
+          //  /**
+          //  * 容重下限
+          //  */
+          // private Float bulkDensityMin;
+          // /**
+          //  * 容重上限
+          //  */
+          // private Float bulkDensityMax;
+          // /**
+          //  * 容重单价
+          //  */
+          // private Float bulkDensityPrice;
+        } else {
+          //以容重构造打印数据
+          let price = []
+          let weight = []
+          let _obj1 = {}
+          let _Lists = []
+          for (let num = 0; num < this.priceRZObjDb.detailListDb.length; num++) {
+            if (this.priceRZObjDb.detailListDb[num].type == 4) {
+              price.push(this.priceRZObjDb.detailListDb[num].jfprice)
+            } else if (this.priceRZObjDb.detailListDb[num].type == 1) {
+              weight.push(this.priceRZObjDb.detailListDb[num].weight)
             }
           }
-          _Lists.push(_obj1)
+          for (let val = 0; val < price.length; val++) {
+            if (val == 0) {
+              _obj1 = {
+                bulkDensityMax: weight[val],
+                bulkDensityMin: weight[val + 1],
+                bulkDensityPrice: price[val],
+              }
+            } else {
+              _obj1 = {
+                bulkDensityMax: weight[val] - 1,
+                bulkDensityMin: weight[val + 1],
+                bulkDensityPrice: price[val],
+              }
+            }
+            _Lists.push(_obj1)
+          }
+          this.baseInfoForm.detailPrints = _Lists
+          this.tableData1 = _Lists
+          //  /**
+          //  * 容重下限
+          //  */
+          // private Float bulkDensityMin;
+          // /**
+          //  * 容重上限
+          //  */
+          // private Float bulkDensityMax;
+          // /**
+          //  * 容重单价
+          //  */
+          // private Float bulkDensityPrice;
         }
-        this.baseInfoForm.detailPrints = _Lists
-        this.tableData1 = _Lists
-        //  /**
-        //  * 容重下限
-        //  */
-        // private Float bulkDensityMin;
-        // /**
-        //  * 容重上限
-        //  */
-        // private Float bulkDensityMax;
-        // /**
-        //  * 容重单价
-        //  */
-        // private Float bulkDensityPrice;
       } else {
         //以水分构造打印数据
         // 获取等级对应分界钱数
@@ -1968,36 +2178,70 @@ export default {
       let _pointPrice = []
       let _basePrice = 0
       if (this.baseInfoForm.bulkDensityStandard == 1) {
-        // this.isSolidFood = true
-        //以容重查看
-        _pointPrice = _priceList[0].pointPrice.split(',')
-        _detailList = _priceList[0].point.split(',')
-        let count = _pointPrice.length + _detailList.length
-        let obj = {}
-        let index = 0
-        let index1 = 0
-        this.priceRZObj.detailList = []
-        for (let j = 0; j < count; j++) {
-          if (j % 2 == 0) {
-            obj = {
-              type: 1,
-              name: '容重',
-              weight: _detailList[index],
-              isWrite: false,
-              isShow: true,
-            }
-            if (j == 0) {
-              obj.isShow = false
+        if (this.baseInfoForm.goodsName == '大豆') {
+          //以容重查看
+          _pointPrice = _priceList[0].pointPrice.split(',')
+          _detailList = _priceList[0].point.split(',')
+          let count = _pointPrice.length + _detailList.length
+          let obj = {}
+          let index = 0
+          let index1 = 0
+          this.priceRZObjDb.detailListDb = []
+          for (let j = 0; j < count; j++) {
+            if (j % 2 == 0) {
+              obj = {
+                type: 1,
+                name: '蛋白',
+                weight: _detailList[index],
+                isWrite: false,
+                isShow: true,
+              }
+              if (j == 0) {
+                obj.isShow = false
+              }
+              index++
+            } else {
+              obj = {
+                type: 4,
+                jfprice: _pointPrice[index1],
+              }
+              index1++
             }
-            index++
-          } else {
-            obj = {
-              type: 4,
-              jfprice: _pointPrice[index1],
+            this.priceRZObjDb.detailListDb.push(obj)
+          }
+        }
+        else {
+          // this.isSolidFood = true
+          //以容重查看
+          _pointPrice = _priceList[0].pointPrice.split(',')
+          _detailList = _priceList[0].point.split(',')
+          let count = _pointPrice.length + _detailList.length
+          let obj = {}
+          let index = 0
+          let index1 = 0
+          this.priceRZObj.detailList = []
+          for (let j = 0; j < count; j++) {
+            if (j % 2 == 0) {
+              obj = {
+                type: 1,
+                name: '容重',
+                weight: _detailList[index],
+                isWrite: false,
+                isShow: true,
+              }
+              if (j == 0) {
+                obj.isShow = false
+              }
+              index++
+            } else {
+              obj = {
+                type: 4,
+                jfprice: _pointPrice[index1],
+              }
+              index1++
             }
-            index1++
+            this.priceRZObj.detailList.push(obj)
           }
-          this.priceRZObj.detailList.push(obj)
         }
       } else {
         //以水分查看

+ 34 - 26
src/views/profitable/expensemanagementdetails.vue

@@ -384,11 +384,10 @@ export default {
       moneyList:[],
       personList:[],
       warehousNameList:[],
-      warehouseName:""
+      warehouseName:''
     }
   },
   activated() {
-  
     this.getPassYearFormatDate()
     this.getList()
     this.xiala()
@@ -800,30 +799,35 @@ export default {
     //   this.$router.push({name:'contractinventory'})
     // },
     getPassYearFormatDate() {
-      var nowDate = new Date()
-      var _date = new Date()
-      nowDate.setTime(nowDate.getTime() - 24 * 60 * 60 * 1000 * 30)
-      var year = nowDate.getFullYear()
-      var year1 = _date.getFullYear()
-      var month = nowDate.getMonth() + 1
-      var month1 = _date.getMonth() + 1
-      var strDate = nowDate.getDate()
-      var strDate1 = _date.getDate()
-      if (month >= 1 && month <= 9) {
-        month = '0' + month
-      }
-      if (month1 >= 1 && month1 <= 9) {
-        month1 = '0' + month1
-      }
+      if (!localStorage.getItem('startDate') && !localStorage.getItem('endDate')) {
+        var nowDate = new Date()
+        var _date = new Date()
+        nowDate.setTime(nowDate.getTime() - 24 * 60 * 60 * 1000 * 30)
+        var year = nowDate.getFullYear()
+        var year1 = _date.getFullYear()
+        var month = nowDate.getMonth() + 1
+        var month1 = _date.getMonth() + 1
+        var strDate = nowDate.getDate()
+        var strDate1 = _date.getDate()
+        if (month >= 1 && month <= 9) {
+          month = '0' + month
+        }
+        if (month1 >= 1 && month1 <= 9) {
+          month1 = '0' + month1
+        }
 
-      if (strDate >= 0 && strDate <= 9) {
-        strDate = '0' + strDate
-      }
-      if (strDate1 >= 0 && strDate1 <= 9) {
-        strDate1 = '0' + strDate1
+        if (strDate >= 0 && strDate <= 9) {
+          strDate = '0' + strDate
+        }
+        if (strDate1 >= 0 && strDate1 <= 9) {
+          strDate1 = '0' + strDate1
+        }
+        this.startDate = year + '-' + month + '-' + strDate
+        this.endDate = year1 + '-' + month1 + '-' + strDate1
+      }else{
+        this.startDate = localStorage.getItem('startDate')
+        this.endDate = localStorage.getItem('endDate')
       }
-      this.startDate = year + '-' + month + '-' + strDate
-      this.endDate = year1 + '-' + month1 + '-' + strDate1
       this.value = [this.startDate, this.endDate]
     },
     getList() {
@@ -831,8 +835,10 @@ export default {
       getexenseinfo({
         // warehouseType: 1,
         compId: localStorage.getItem('ws-pf_compId'),
-        startDate: this.startDate,
-        endDate: this.endDate,
+        // startDate: this.startDate,
+        // endDate: this.endDate,
+        startDate: localStorage.getItem('startDate'),
+        endDate: localStorage.getItem('endDate'),
         searchKeyWord: this.searchKeyWord,
         currentPage: this.currentPage,
         pageSize: this.pageSize,
@@ -876,6 +882,8 @@ export default {
       if (this.value) {
         this.startDate = this.value[0]
         this.endDate = this.value[1]
+        localStorage.setItem('startDate', this.startDate)
+        localStorage.setItem('endDate', this.endDate)
       }
       this.getList()
     },