|
@@ -3,7 +3,6 @@
|
|
|
v-bind="$attrs"
|
|
|
@register="register"
|
|
|
title="验收凭证"
|
|
|
- :okText="okText"
|
|
|
@cancel="resetFields"
|
|
|
@ok="handleSubmit"
|
|
|
>
|
|
@@ -15,14 +14,13 @@
|
|
|
</BasicModal>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, nextTick, onMounted, reactive, ref } from 'vue';
|
|
|
+ import { defineComponent, nextTick, onMounted, reactive, ref, h } from 'vue';
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { signFor } from '/@/api/spares/index';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { uploadApi } from '/@/api/product/index';
|
|
|
- import { ResultEnum } from '/@/enums/httpEnum';
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
export default defineComponent({
|
|
@@ -32,12 +30,12 @@
|
|
|
},
|
|
|
emits: ['update', 'register'],
|
|
|
setup(props, { emit }) {
|
|
|
+ const { createMessage, createConfirm } = useMessage();
|
|
|
const fileFlow = reactive({
|
|
|
file: null,
|
|
|
type: 2, //2-普通发票,3-专用发票
|
|
|
});
|
|
|
const okText = ref('发送');
|
|
|
- const { createMessage } = useMessage();
|
|
|
const schemas: FormSchema[] = [
|
|
|
{
|
|
|
field: 'repairId',
|
|
@@ -104,15 +102,23 @@
|
|
|
});
|
|
|
}
|
|
|
const handleSubmit = async () => {
|
|
|
+ const params = await validate();
|
|
|
try {
|
|
|
- const params = await validate();
|
|
|
- const apiData = params;
|
|
|
- console.log('res', apiData, params);
|
|
|
- await signFor(apiData);
|
|
|
- closeModal();
|
|
|
- resetFields();
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- emit('update');
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: () => h('span', '温馨提示'),
|
|
|
+ content: '确定提交验收凭证吗?',
|
|
|
+ onOk: async () => {
|
|
|
+ await signFor(params);
|
|
|
+ createMessage.success(t('common.optSuccess'));
|
|
|
+ closeModal();
|
|
|
+ emit('update');
|
|
|
+ },
|
|
|
+ });
|
|
|
+ // const apiData = params;
|
|
|
+ // console.log('res', apiData, params);
|
|
|
+ // closeModal();
|
|
|
+ // resetFields();
|
|
|
} catch (error) {
|
|
|
console.log('not passing', error);
|
|
|
}
|