|
@@ -10,7 +10,7 @@
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<a-button key="submit"
|
|
<a-button key="submit"
|
|
|
class="cancelBtn"
|
|
class="cancelBtn"
|
|
|
- @click="cancel">保存草稿</a-button>
|
|
|
|
|
|
|
+ @click="submit">保存草稿</a-button>
|
|
|
<a-button key="submit"
|
|
<a-button key="submit"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
@@ -81,16 +81,14 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="销售方"
|
|
|
|
|
- name="SellUserID">
|
|
|
|
|
|
|
+ <a-form-item label="销售方">
|
|
|
<span class="white">{{getUserName()}}</span>
|
|
<span class="white">{{getUserName()}}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="采购方"
|
|
|
|
|
- name="BuyUserID">
|
|
|
|
|
|
|
+ <a-form-item label="采购方">
|
|
|
<span class="white">{{getUserName()}}</span>
|
|
<span class="white">{{getUserName()}}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
@@ -412,13 +410,15 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, ref, toRaw } from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
import { initData } from '@/common/methods';
|
|
import { initData } from '@/common/methods';
|
|
|
import { handleFromState, handleContract, handlevalidate, handleDeliveryGoods, handlePrice, handleDate } from './setup';
|
|
import { handleFromState, handleContract, handlevalidate, handleDeliveryGoods, handlePrice, handleDate } from './setup';
|
|
|
import { getUserName } from '@/services/bus/user';
|
|
import { getUserName } from '@/services/bus/user';
|
|
|
import { getGoodsList } from '@/services/bus/goods';
|
|
import { getGoodsList } from '@/services/bus/goods';
|
|
|
import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
|
|
import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
|
|
|
|
|
+import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
|
|
|
|
|
+import { FormState } from './interface';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'add-spot-contract',
|
|
name: 'add-spot-contract',
|
|
@@ -461,11 +461,15 @@ export default defineComponent({
|
|
|
// 现货商品列表
|
|
// 现货商品列表
|
|
|
const goodsList = ref<Goods[]>([]);
|
|
const goodsList = ref<Goods[]>([]);
|
|
|
function submit() {
|
|
function submit() {
|
|
|
- loading.value = true;
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- loading.value = false;
|
|
|
|
|
- cancel();
|
|
|
|
|
- }, 2000);
|
|
|
|
|
|
|
+ formRef.value
|
|
|
|
|
+ .validate()
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ const param = toRaw(formState);
|
|
|
|
|
+ console.log('values', formState);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error: ValidateErrorEntity<FormState>) => {
|
|
|
|
|
+ console.log('error', error);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
initData(() => {
|
|
initData(() => {
|
|
|
queryCustomList();
|
|
queryCustomList();
|
|
@@ -476,6 +480,7 @@ export default defineComponent({
|
|
|
visible,
|
|
visible,
|
|
|
cancel,
|
|
cancel,
|
|
|
submit,
|
|
submit,
|
|
|
|
|
+ formRef,
|
|
|
loading,
|
|
loading,
|
|
|
maskClosableFlag: false,
|
|
maskClosableFlag: false,
|
|
|
formState,
|
|
formState,
|