浏览代码

no message

linwenxin 5 月之前
父节点
当前提交
6cf154b625
共有 1 个文件被更改,包括 16 次插入1 次删除
  1. 16 1
      src/views/workOrder/basicConfiguration/assessmentItemAllocation/index.vue

+ 16 - 1
src/views/workOrder/basicConfiguration/assessmentItemAllocation/index.vue

@@ -145,7 +145,22 @@ export default {
             var { value } = props
             return (
               <div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-                <el-input v-model={this.formData.amount} type="number" placeholder="请输入"></el-input>
+                <el-input
+                  disabled={!this.formData.type}
+                  value={this.formData.amount}
+                  onInput={v => {
+                    console.log(v)
+                    if (v && this.formData.type == 'REWARD' && v < 0) {
+                      this.formData.amount = 0
+                    } else if (v && this.formData.type == 'PUNISH' && v > 0) {
+                      this.formData.amount = 0
+                    } else {
+                      this.formData.amount = v
+                    }
+                  }}
+                  type="number"
+                  placeholder="请输入"
+                ></el-input>
                 <span style="margin-left: 10px;">元</span>
               </div>
             )