ソースを参照

fix: 创建payment record. 修正payment type 参数. 修正statement name下拉框无法被选择的问题.

peter 1 年間 前
コミット
850bc69948

+ 9 - 27
src/pages/payment-record/components/edit.vue

@@ -108,23 +108,17 @@
 
             <el-form-item
               label="Statement Name"
-              prop="statement"
+              prop="statement_name"
             >
               <el-select
-                v-model="form.statement"
+                v-model="form.statement_name"
                 style="width: 100%"
-                @change="
-                  (v) => {
-                    form.statement_id = v.value
-                    form.statement_name = v.label
-                  }
-                "
               >
                 <el-option
-                  v-for="option in statementList as IOptionItem[]"
-                  :key="option.value"
+                  v-for="(option, index) in statementList as IOptionItem[]"
+                  :key="index"
                   :label="option.label"
-                  :value="option"
+                  :value="option.label"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -261,18 +255,10 @@ const formRule = ref<FormRules>({
   //   message: '必填项',
   //   trigger: 'blur',
   // },
-  statement: {
+  statement_name: {
     required: true,
-    trigger: 'change',
-    asyncValidator: (rule, v) => {
-      return new Promise((resolve, reject) => {
-        if (v.value && v.label) {
-          resolve()
-        } else {
-          reject('必填项')
-        }
-      })
-    },
+    message: '必填项',
+    trigger: 'blur',
   },
   total: {
     required: true,
@@ -317,7 +303,6 @@ watchEffect(() => {
       setup_service_fee: '',
       total: '',
       currency: 'CNY',
-      statement: {}, // 混入了特殊字段, 下拉选项需要同时变更两个字段, 不这样做不出效果
       statement_name: '',
       statement_id: '',
       description: '',
@@ -325,10 +310,7 @@ watchEffect(() => {
     },
     JSON.parse(JSON.stringify(props.currentEditRow)),
   )
-  form.value.statement = {
-    label: form.value.statement_name,
-    value: form.value.statement_id,
-  }
+
   if (props.disableFlag) {
     form.value.currency = props.lockedCurrency
   }

+ 1 - 0
src/pages/payment-record/index.vue

@@ -405,6 +405,7 @@ const save = function () {
       Currency: i.currency,
       Description: i.description,
       PO_id: i.po_number,
+      Payment_Type: i.payment_type,
       Statement: { name: i.statement_name, id: statementID.value },
       Request_Type: '月结申请',
       Name: '/',