|
@@ -88,7 +88,7 @@
|
|
|
<a-form class="inlineForm"
|
|
<a-form class="inlineForm"
|
|
|
ref="formRef"
|
|
ref="formRef"
|
|
|
:model="formState"
|
|
:model="formState"
|
|
|
- :rules="formStateRules">
|
|
|
|
|
|
|
+ :rules="rules">
|
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
<a-form-item label="点价价格"
|
|
<a-form-item label="点价价格"
|
|
@@ -153,8 +153,9 @@ import { getPriceTypeName } from '@/views/business/purchase/setup';
|
|
|
import { operationContractReq } from '@/services/proto/contract';
|
|
import { operationContractReq } from '@/services/proto/contract';
|
|
|
import { message } from 'ant-design-vue';
|
|
import { message } from 'ant-design-vue';
|
|
|
import { objectToUint8Array } from '@/utils/objHandle';
|
|
import { objectToUint8Array } from '@/utils/objHandle';
|
|
|
-import {InvoiceReq, SettlementReq} from "@/services/proto/contract/interface";
|
|
|
|
|
-import {invoiceReq, settlementReq} from "@/views/business/purchase/components/setup";
|
|
|
|
|
|
|
+import { InvoiceReq, SettlementReq } from '@/services/proto/contract/interface';
|
|
|
|
|
+import { invoiceReq, settlementReq } from '@/views/business/purchase/components/setup';
|
|
|
|
|
+import { handleForm } from './setup';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'purchase_pending_invoice',
|
|
name: 'purchase_pending_invoice',
|
|
@@ -165,40 +166,24 @@ export default defineComponent({
|
|
|
default: {},
|
|
default: {},
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- setup(props,context) {
|
|
|
|
|
|
|
+ setup(props, context) {
|
|
|
const { visible, cancel } = closeModal('purchase_pending_invoice');
|
|
const { visible, cancel } = closeModal('purchase_pending_invoice');
|
|
|
const loading = ref<boolean>(false);
|
|
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 } = handleForm();
|
|
|
function submit() {
|
|
function submit() {
|
|
|
const wrapEl = unref(formRef);
|
|
const wrapEl = unref(formRef);
|
|
|
wrapEl.validate().then(() => {
|
|
wrapEl.validate().then(() => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
- const params : InvoiceReq = {
|
|
|
|
|
|
|
+ const params: InvoiceReq = {
|
|
|
InvoiceAmount: 123,
|
|
InvoiceAmount: 123,
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
// 发出发票登记
|
|
// 发出发票登记
|
|
|
- invoiceReq(
|
|
|
|
|
- props.selectedRow.spotcontractid,
|
|
|
|
|
- params,
|
|
|
|
|
- loading)
|
|
|
|
|
|
|
+ invoiceReq(props.selectedRow.spotcontractid, params, loading)
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
cancel();
|
|
cancel();
|
|
|
- context.emit('refresh')
|
|
|
|
|
|
|
+ context.emit('refresh');
|
|
|
})
|
|
})
|
|
|
- .catch((err) => {
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ .catch((err) => {});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -210,7 +195,7 @@ export default defineComponent({
|
|
|
formRef,
|
|
formRef,
|
|
|
formState,
|
|
formState,
|
|
|
formatValue,
|
|
formatValue,
|
|
|
- formStateRules,
|
|
|
|
|
|
|
+ rules,
|
|
|
getPriceTypeName,
|
|
getPriceTypeName,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|