Jelajahi Sumber

Merge remote-tracking branch 'origin/金牛明医' into 金牛明医

ct 2 minggu lalu
induk
melakukan
24753497e7
1 mengubah file dengan 29 tambahan dan 1 penghapusan
  1. 29 1
      src/views/his/integralGoods/index.vue

+ 29 - 1
src/views/his/integralGoods/index.vue

@@ -215,6 +215,15 @@
             >{{dict.dictLabel}}</el-radio>
           </el-radio-group>
         </el-form-item>
+        <el-form-item label="是否限兑">
+          <el-radio-group v-model="form.isExchange">
+            <el-radio
+              v-for="dict in exchangeOptions"
+              :key="dict.dictValue"
+              :label="parseInt(dict.dictValue)"
+            >{{dict.dictLabel}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -322,6 +331,7 @@ export default {
       goodsTypeOptions: [],
       // 状态字典
       statusOptions: [],
+      exchangeOptions: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -353,6 +363,9 @@ export default {
     this.getDicts("sys_company_status").then(response => {
       this.statusOptions = response.data;
     });
+    this.getDicts("sys_exchange").then(response => {
+      this.exchangeOptions = response.data;
+    });
   },
   methods: {
         handledetails(row){
@@ -420,7 +433,8 @@ export default {
         sort: null,
         stock: null,
         descs: null,
-        createTime: null
+        createTime: null,
+        isExchange:0
       };
       this.resetForm("form");
     },
@@ -524,6 +538,20 @@ export default {
           this.download(response.msg);
           this.exportLoading = false;
         }).catch(() => {});
+    },
+
+    onExchangeInput(val) {
+      // 允许空(不限)
+      if (val === '' || val === null) {
+        this.form.exchangeCount = null;
+        return;
+      }
+
+      // 只保留正整数字符
+      const num = val.replace(/[^\d]/g, '');
+
+      // 去掉前导 0
+      this.form.exchangeCount = num.replace(/^0+/, '');
     }
   }
 };