|
|
@@ -103,7 +103,7 @@
|
|
|
<a-form class="inlineForm"
|
|
|
ref="formRef"
|
|
|
:model="formState"
|
|
|
- :rules="formStateRules">
|
|
|
+ :rules="rules">
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="点价价格"
|
|
|
@@ -160,16 +160,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, PropType, reactive, ref, unref } from 'vue';
|
|
|
+import { defineComponent, PropType, ref, unref } from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
import { formatValue } from '@/common/methods';
|
|
|
import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
|
|
|
import { getPriceTypeName } from '@/views/business/purchase/setup';
|
|
|
-import { operationContractReq } from '@/services/proto/contract';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
-import { objectToUint8Array } from '@/utils/objHandle';
|
|
|
import { settlementReq } from '@/views/business/purchase/components/setup';
|
|
|
import { SettlementReq } from '@/services/proto/contract/interface';
|
|
|
+import { handleForm } from './setup';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'purchase_pending_settlement',
|
|
|
@@ -184,24 +182,12 @@ export default defineComponent({
|
|
|
const { visible, cancel } = closeModal('purchase_pending_settlement');
|
|
|
const loading = ref<boolean>(false);
|
|
|
|
|
|
- const formRef = ref();
|
|
|
- const formState = reactive({ PricedPrice: 0, PricedQty: 0 });
|
|
|
- const numberIstrue = (rule: any, value: any) => {
|
|
|
- if (!value) {
|
|
|
- return Promise.reject(new Error('请输入正确的值'));
|
|
|
- } else {
|
|
|
- return Promise.resolve();
|
|
|
- }
|
|
|
- };
|
|
|
- const formStateRules = {
|
|
|
- PricedPrice: [{ required: true, validator: numberIstrue, trigger: 'blur', type: 'number' }],
|
|
|
- PricedQty: [{ required: true, validator: numberIstrue, trigger: 'blur', type: 'number' }],
|
|
|
- };
|
|
|
+ const { rules, formState, formRef, checkedObj } = handleForm();
|
|
|
+
|
|
|
function submit() {
|
|
|
const wrapEl = unref(formRef);
|
|
|
wrapEl.validate().then(() => {
|
|
|
loading.value = true;
|
|
|
-
|
|
|
const params: SettlementReq = {
|
|
|
ReckonRealQty: 10, // 交收量
|
|
|
ReckonOtherAmount: 11, // 其它费用
|
|
|
@@ -227,7 +213,7 @@ export default defineComponent({
|
|
|
formRef,
|
|
|
formState,
|
|
|
formatValue,
|
|
|
- formStateRules,
|
|
|
+ rules,
|
|
|
getPriceTypeName,
|
|
|
};
|
|
|
},
|