Преглед на файлове

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

gjy преди 2 години
родител
ревизия
86e49bd1ff
променени са 2 файла, в които са добавени 43 реда и са изтрити 39 реда
  1. 42 38
      src/views/houseSelfCollect/newWeighingManagement.vue
  2. 1 1
      src/views/outboundManagement/weighingManagementNew.vue

+ 42 - 38
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -203,7 +203,7 @@
               </el-table-column>
               <el-table-column property="carNumber" label="车牌号">
               </el-table-column>
-              <el-table-column property="status" label="状态">c
+              <el-table-column property="status" label="状态">
               </el-table-column>
             </el-table>
             <div style="text-align: center">
@@ -1776,12 +1776,19 @@ export default {
                   })
               } else { //收购入库
                 //毛检保存前进行校验
-                // if (this.purchasePriceList) {
-                for (let i = 0; i < this.purchasePriceList.length; i++) {
-                  if (
-                    this.weighingList.goodsName ==
-                    this.purchasePriceList[i].goodsName
-                  ) {
+                var arr = {}
+                // if (this.purchasePriceList.length != 0) {
+                  for (let i = 0; i < this.purchasePriceList.length; i++) {
+                    if (
+                      this.weighingList.goodsName ==
+                      this.purchasePriceList[i].goodsName
+                    ) {
+                      arr = JSON.parse(JSON.stringify(this.purchasePriceList[i]))
+                      arr.saleLimit = this.purchasePriceList[i].saleLimit
+                    }
+                  }
+                  // console.log('1111111',arr)
+                  if (Object.keys(arr).length != 0) {
                     getamount({
                       compId: localStorage.getItem('ws-pf_compId'),
                       customerNumberCard: this.weighingList.customerNumberCard,
@@ -1791,7 +1798,7 @@ export default {
                       .then((response) => {
                         //累计售粮超上限不能完成毛检保存
                         let count = (
-                          this.purchasePriceList[i].saleLimit -
+                          arr.saleLimit -
                           response / 1000
                         ).toFixed(2)
                         if (count - this.weighingList.grossWeight / 1000 < 0) {
@@ -1827,20 +1834,18 @@ export default {
                             })
                         }
                       })
-                    break
+                    return
                   }
                   else {
-                    // this.$message({
-                    //   message: this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作',
-                    //   type: 'warning',
-                    // })
-                    // return
                     this.$alert(this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作', {
                       confirmButtonText: '确定',
                     })
-
                   }
-                }
+                // }
+                // else {
+                //   this.$message.error('该仓库未设置收购价格或收购价格正在审核中,请审核通过后进行操作')
+                //   return
+                // }
                 //累计售粮没有超上限完成毛检保存
                 // this.weighingList.relationId = this.relationId;
                 // grossWeight(this.weighingList)
@@ -1905,34 +1910,33 @@ export default {
                   })
               } else { //收购入库
                 for (let i = 0; i < this.purchasePriceList.length; i++) {
+                  var arr1 = {}
                   if (
                     this.weighingList.goodsName ==
                     this.purchasePriceList[i].goodsName
                   ) {
-                    grossWeight(this.weighingList)
-                      .toPromise()
-                      .then((response) => {
-                        if (this.reader) {
-                          this.reader.cancel()
-                        }
-                        this.$notify.success({
-                          title: '成功',
-                          message: '保存成功',
-                        })
-                        this.getList()
-                      })
-                    break
+                    arr1 = JSON.parse(JSON.stringify(this.purchasePriceList[i]))
                   }
-                  else {
-                    // this.$message({
-                    //   message: this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作',
-                    //   type: 'warning',
-                    // })
-                    // return
-                    this.$alert(this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作', {
-                      confirmButtonText: '确定',
+                }
+                if (Object.keys(arr1).length != 0) {
+                  grossWeight(this.weighingList)
+                    .toPromise()
+                    .then((response) => {
+                      if (this.reader) {
+                        this.reader.cancel()
+                      }
+                      this.$notify.success({
+                        title: '成功',
+                        message: '保存成功',
+                      })
+                      this.getList()
                     })
-                  }
+                  return
+                }
+                else {
+                  this.$alert(this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作', {
+                    confirmButtonText: '确定',
+                  })
                 }
               }
               // grossWeight(this.weighingList)

+ 1 - 1
src/views/outboundManagement/weighingManagementNew.vue

@@ -169,7 +169,7 @@
                     ">
                         <el-input :maxlength="'7'" v-if="carjudge||!carjudge&&tpyeNo==2&&!weighingList.tranCarNo" v-model="weighingList.carNo" placeholder="请输入车牌号"
                            size="small" :disabled="recheck1"/>
-                        <el-select v-if="!carjudge&&tpyeNo==1||!carjudge&&tpyeNo==2&&weighingList.tranCarNo" filterable clearable v-model="weighingList.carId" placeholder="请选择车牌号"
+                        <el-select v-if="!carjudge&&tpyeNo==1||!carjudge&&tpyeNo==2&&weighingList.tranCarNo" filterable clearable v-model="weighingList.carNo" placeholder="请选择车牌号"
                           class="typeselect" @change="carChange" :disabled="recheck1">
                           <el-option v-for="item in options2" :key="item.constKey"
                             :label="item.carNo + '(' + item.tranCarNo + ')'" :value="item.id" />