ソースを参照

feature(发票管理): 发票提交审核时,去掉对金额为0的校验

lk 2 年 前
コミット
2dd4dd49e6
1 ファイル変更10 行追加2 行削除
  1. 10 2
      src/views/contract/components/ApplyInvoice.vue

+ 10 - 2
src/views/contract/components/ApplyInvoice.vue

@@ -16,7 +16,14 @@
         </el-radio-group>
       </el-form-item>
       <el-form-item label="回款金额(元)">
-        <el-input v-model.number="form.receiveAmount" clearable placeholder="请输入回款金额(元)" />
+        <el-input-number
+          v-model.number="form.receiveAmount"
+          clearable
+          controls-position="right"
+          :min="0"
+          placeholder="请输入回款金额(元)"
+          :precision="2"
+          style="width: 250px" />
       </el-form-item>
     </el-form>
     <span slot="footer">
@@ -50,7 +57,8 @@
         }
       },
       async handleSubmit() {
-        if (this.form.receiveAmount <= 0) return this.$message.warning('请输入回款金额')
+        if (this.form.receiveAmount === '') return this.$message.warning('请输入回款金额')
+        if (this.form.receiveAmount < 0) return this.$message.warning('回款金额不能为负数')
         const [err, res] = await to(
           invoiceApi.applyInvoice({
             id: this.form.id,