gjy 3 vuotta sitten
vanhempi
commit
f8a9bf8fec
1 muutettua tiedostoa jossa 18 lisäystä ja 1 poistoa
  1. 18 1
      src/views/warehouse/costmanagement.vue

+ 18 - 1
src/views/warehouse/costmanagement.vue

@@ -90,7 +90,7 @@
       <el-dialog title="修改加权成本价格" :visible.sync="editvisible">
         <el-form >
           <el-form-item label="价格(元/吨)" >
-            <el-input v-model="price" autocomplete="off"></el-input>
+            <el-input placeholder="输入加权成本价格" v-model="price" autocomplete="off"></el-input>
           </el-form-item>
         </el-form>
         <div slot="footer" class="dialog-footer">
@@ -218,6 +218,23 @@ export default {
       this.id=item.id
     },
     editprice(){
+      if(!this.price){
+            this.$message({
+              message: '价格不能为空!',
+              type: 'warning'
+            })
+            return
+        }
+      if(this.price<0||this.price>20000||(String(this.price).indexOf('.') != -1 &&
+						String(this.price).length -
+						(String(this.price).indexOf('.') +1) >
+						2)){
+            this.$message({
+              message: '价格输入错误!',
+              type: 'warning'
+            })
+            return
+        }
       this.$confirm(`加权成本价格修改后不可恢复,确认提交`, {
         confirmButtonText: '确定',
         cancelButtonText: '取消',