|
@@ -98,7 +98,7 @@
|
|
|
<template v-for="(domain, index) in formState.gldwrstandards"
|
|
<template v-for="(domain, index) in formState.gldwrstandards"
|
|
|
:key="domain.index + 'domain'">
|
|
:key="domain.index + 'domain'">
|
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
|
- <a-form-item :name="['wrstandardname', index]"
|
|
|
|
|
|
|
+ <a-form-item :name="['gldwrstandards',index, 'wrstandardname', ]"
|
|
|
:rules="rules.gldwrstandards.wrstandardname">
|
|
:rules="rules.gldwrstandards.wrstandardname">
|
|
|
<a-input class="dialogInput"
|
|
<a-input class="dialogInput"
|
|
|
v-model:value="domain.wrstandardname"
|
|
v-model:value="domain.wrstandardname"
|
|
@@ -106,7 +106,7 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
|
- <a-form-item :name="['unitid', index]"
|
|
|
|
|
|
|
+ <a-form-item :name="['gldwrstandards',index,'unitid' ]"
|
|
|
:rules="rules.gldwrstandards.unitid">
|
|
:rules="rules.gldwrstandards.unitid">
|
|
|
<a-select class="inlineFormSelect"
|
|
<a-select class="inlineFormSelect"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
@@ -121,21 +121,24 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
|
- <a-form-item :name="['convertfactor', index]"
|
|
|
|
|
|
|
+ <a-form-item :name="['gldwrstandards',index,'convertfactor']"
|
|
|
:rules="rules.gldwrstandards.convertfactor">
|
|
:rules="rules.gldwrstandards.convertfactor">
|
|
|
<a-input class="dialogInput"
|
|
<a-input class="dialogInput"
|
|
|
v-model:value="domain.convertfactor"
|
|
v-model:value="domain.convertfactor"
|
|
|
|
|
+ type="number"
|
|
|
placeholder="请输入标仓系数"></a-input>
|
|
placeholder="请输入标仓系数"></a-input>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
|
<a-button class="plusBtn"
|
|
<a-button class="plusBtn"
|
|
|
|
|
+ @click="deleteOne('gldwrstandards', index)"
|
|
|
v-if="index > 0">
|
|
v-if="index > 0">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
|
<MinusOutlined />
|
|
<MinusOutlined />
|
|
|
</template>
|
|
</template>
|
|
|
</a-button>
|
|
</a-button>
|
|
|
- <a-button class="minusBtn">
|
|
|
|
|
|
|
+ <a-button class="minusBtn"
|
|
|
|
|
+ @click="addOne('gldwrstandards')">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
|
<PlusOutlined />
|
|
<PlusOutlined />
|
|
|
</template>
|
|
</template>
|
|
@@ -143,20 +146,7 @@
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</template>
|
|
</template>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
- <!-- <a-form-item
|
|
|
|
|
- v-for="(domain, index) in dynamicValidateForm.gldwrstandards"
|
|
|
|
|
- :key="domain.index + 'domain'"
|
|
|
|
|
- v-bind="index === 0 ? formItemLayout : {}"
|
|
|
|
|
- :name="['domains', index, 'value']"
|
|
|
|
|
- :rules="{
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: 'domain can not be null',
|
|
|
|
|
- trigger: 'change',
|
|
|
|
|
- }"
|
|
|
|
|
- >
|
|
|
|
|
-
|
|
|
|
|
- </a-form-item> -->
|
|
|
|
|
- <a-table class="dialogTable"
|
|
|
|
|
|
|
+ <!-- <a-table class="dialogTable"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:data-source="dataSource"
|
|
:data-source="dataSource"
|
|
|
:pagination="false">
|
|
:pagination="false">
|
|
@@ -209,11 +199,50 @@
|
|
|
</template>
|
|
</template>
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</template>
|
|
</template>
|
|
|
- </a-table>
|
|
|
|
|
|
|
+ </a-table> -->
|
|
|
</fieldset>
|
|
</fieldset>
|
|
|
<fieldset class="formFieldSet">
|
|
<fieldset class="formFieldSet">
|
|
|
<legend>品牌信息</legend>
|
|
<legend>品牌信息</legend>
|
|
|
- <a-table class="dialogTable"
|
|
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="12">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <span class="red">*</span>
|
|
|
|
|
+ 品牌
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="12">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ 操作
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <template v-for="(domain, index) in formState.glddgfactoryItems"
|
|
|
|
|
+ :key="domain.index + 'domain'">
|
|
|
|
|
+ <a-col :span="12">
|
|
|
|
|
+ <a-form-item :name="['glddgfactoryItems',index,'dgfactoryitemvalue']"
|
|
|
|
|
+ :rules="rules.glddgfactoryItems.dgfactoryitemvalue">
|
|
|
|
|
+ <a-input class="dialogInput"
|
|
|
|
|
+ v-model:value="domain.dgfactoryitemvalue"
|
|
|
|
|
+ placeholder="请输入品牌"></a-input>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="12">
|
|
|
|
|
+ <a-button class="plusBtn"
|
|
|
|
|
+ @click="deleteOne('glddgfactoryItems', index)"
|
|
|
|
|
+ v-if="index > 0">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <MinusOutlined />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+ <a-button class="minusBtn"
|
|
|
|
|
+ @click="addOne('glddgfactoryItems')">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <PlusOutlined />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <!-- <a-table class="dialogTable"
|
|
|
:columns="columns1"
|
|
:columns="columns1"
|
|
|
:data-source="dataSource1"
|
|
:data-source="dataSource1"
|
|
|
:pagination="false">
|
|
:pagination="false">
|
|
@@ -239,11 +268,86 @@
|
|
|
</template>
|
|
</template>
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</template>
|
|
</template>
|
|
|
- </a-table>
|
|
|
|
|
|
|
+ </a-table> -->
|
|
|
</fieldset>
|
|
</fieldset>
|
|
|
<fieldset class="formFieldSet">
|
|
<fieldset class="formFieldSet">
|
|
|
<legend>套保品种信息</legend>
|
|
<legend>套保品种信息</legend>
|
|
|
- <a-table class="dialogTable"
|
|
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="6">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <span class="red">*</span>
|
|
|
|
|
+ 套保品种
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="6">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <span class="red">*</span>
|
|
|
|
|
+ 单位
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="6">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <span class="red">*</span>
|
|
|
|
|
+ 套保系数
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="6">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ 操作
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <template v-for="(domain, index) in formState.wrsconvertdetails"
|
|
|
|
|
+ :key="domain.index + 'domain'">
|
|
|
|
|
+ <a-col :span="6">
|
|
|
|
|
+ <a-form-item :name="['wrsconvertdetails',index,'middlegoodsid']"
|
|
|
|
|
+ :rules="rules.wrsconvertdetails.middlegoodsid">
|
|
|
|
|
+ <a-select class="inlineFormSelect"
|
|
|
|
|
+ style="width: 200px"
|
|
|
|
|
+ v-model:value="domain.middlegoodsid"
|
|
|
|
|
+ placeholder="请选择品类">
|
|
|
|
|
+ <a-select-option v-for="item in unitList"
|
|
|
|
|
+ :value="item.enumitemname"
|
|
|
|
|
+ :key="item.autoid">
|
|
|
|
|
+ {{item.enumdicname}}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="6">
|
|
|
|
|
+ <a-form-item :name="['wrsconvertdetails', index, 'unitid']">
|
|
|
|
|
+ <a-input class="dialogInput"
|
|
|
|
|
+ readonly
|
|
|
|
|
+ v-model:value="domain.unitid"
|
|
|
|
|
+ placeholder="选择套保品种后自动填入"></a-input>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="6">
|
|
|
|
|
+ <a-form-item :name="['wrsconvertdetails', index, 'convertratio']"
|
|
|
|
|
+ :rules="rules.wrsconvertdetails.convertratio">
|
|
|
|
|
+ <a-input class="dialogInput"
|
|
|
|
|
+ v-model:value="domain.convertratio"
|
|
|
|
|
+ type="number"
|
|
|
|
|
+ placeholder="请输入套保系数"></a-input>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="6">
|
|
|
|
|
+ <a-button class="plusBtn"
|
|
|
|
|
+ @click="deleteOne('wrsconvertdetails', index)"
|
|
|
|
|
+ v-if="index > 0">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <MinusOutlined />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+ <a-button class="minusBtn"
|
|
|
|
|
+ @click="addOne('wrsconvertdetails')">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <PlusOutlined />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <!-- <a-table class="dialogTable"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:data-source="dataSource"
|
|
:data-source="dataSource"
|
|
|
:pagination="false">
|
|
:pagination="false">
|
|
@@ -294,7 +398,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</template>
|
|
</template>
|
|
|
- </a-table>
|
|
|
|
|
|
|
+ </a-table> -->
|
|
|
</fieldset>
|
|
</fieldset>
|
|
|
</a-form>
|
|
</a-form>
|
|
|
</a-modal>
|
|
</a-modal>
|
|
@@ -305,20 +409,28 @@ import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
import { initData } from '@/common/methods/index';
|
|
import { initData } from '@/common/methods/index';
|
|
|
import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
|
|
import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
|
|
|
-import { handleAdd, initFormState } from './setup';
|
|
|
|
|
|
|
+import { handleAdd, handleFromState } from './setup';
|
|
|
import { DeliveryGoodsApplyReq } from '@/services/proto/delivery/interface';
|
|
import { DeliveryGoodsApplyReq } from '@/services/proto/delivery/interface';
|
|
|
import { getGoodsUnitList } from '../../setup';
|
|
import { getGoodsUnitList } from '../../setup';
|
|
|
import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
|
import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
|
|
import { FormState } from './interface';
|
|
import { FormState } from './interface';
|
|
|
|
|
|
|
|
-const validateUnit = async (rule: RuleObject, value: number) => {
|
|
|
|
|
|
|
+const validateCommon = (value: any, errInfo: string) => {
|
|
|
if (value) {
|
|
if (value) {
|
|
|
return Promise.resolve();
|
|
return Promise.resolve();
|
|
|
} else {
|
|
} else {
|
|
|
- return Promise.reject('请选择单位');
|
|
|
|
|
|
|
+ return Promise.reject(errInfo);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const validateUnit = async (rule: RuleObject, value: number) => {
|
|
|
|
|
+ return validateCommon(value, '请选择单位');
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const valideteWR = async (rule: RuleObject, value: number) => {
|
|
|
|
|
+ return validateCommon(value, '请选择品类');
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'addSpotVariety',
|
|
name: 'addSpotVariety',
|
|
|
components: {
|
|
components: {
|
|
@@ -412,16 +524,25 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
|
function submit() {
|
|
function submit() {
|
|
|
- loading.value = true;
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- loading.value = false;
|
|
|
|
|
- cancel();
|
|
|
|
|
- }, 2000);
|
|
|
|
|
|
|
+ formRef.value
|
|
|
|
|
+ .validate()
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ const param = toRaw(formState);
|
|
|
|
|
+ console.log('param', param);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error: ValidateErrorEntity<FormState>) => {
|
|
|
|
|
+ console.log('error', error);
|
|
|
|
|
+ });
|
|
|
|
|
+ // loading.value = true;
|
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
|
+ // loading.value = false;
|
|
|
|
|
+ // cancel();
|
|
|
|
|
+ // }, 2000);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 表单
|
|
// 表单
|
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
|
- const formState: UnwrapRef<FormState> = reactive(initFormState(() => {}));
|
|
|
|
|
|
|
+ const { formState, addOne, deleteOne } = handleFromState();
|
|
|
const rules = {
|
|
const rules = {
|
|
|
deliverygoodsname: [{ required: true, message: '请输入现货品种名称', trigger: 'blur' }],
|
|
deliverygoodsname: [{ required: true, message: '请输入现货品种名称', trigger: 'blur' }],
|
|
|
// unitid: [{ required: true, message: '请选择单位', trigger: 'change' }],
|
|
// unitid: [{ required: true, message: '请选择单位', trigger: 'change' }],
|
|
@@ -431,6 +552,13 @@ export default defineComponent({
|
|
|
wrstandardname: { required: true, message: '请输入品类', trigger: 'blur' },
|
|
wrstandardname: { required: true, message: '请输入品类', trigger: 'blur' },
|
|
|
convertfactor: { required: true, message: '请输入标仓系数', trigger: 'blur' },
|
|
convertfactor: { required: true, message: '请输入标仓系数', trigger: 'blur' },
|
|
|
},
|
|
},
|
|
|
|
|
+ glddgfactoryItems: {
|
|
|
|
|
+ dgfactoryitemvalue: { required: true, message: '请输入品牌', trigger: 'blur' },
|
|
|
|
|
+ },
|
|
|
|
|
+ wrsconvertdetails: {
|
|
|
|
|
+ middlegoodsid: { required: true, validator: valideteWR, trigger: 'change' },
|
|
|
|
|
+ convertratio: { required: true, message: '请输入套保系数', trigger: 'blur' },
|
|
|
|
|
+ },
|
|
|
// nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
|
|
// nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
|
|
|
// cardtype: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
|
|
// cardtype: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
|
|
|
};
|
|
};
|
|
@@ -441,6 +569,8 @@ export default defineComponent({
|
|
|
cancel,
|
|
cancel,
|
|
|
formRef,
|
|
formRef,
|
|
|
formState,
|
|
formState,
|
|
|
|
|
+ addOne,
|
|
|
|
|
+ deleteOne,
|
|
|
rules,
|
|
rules,
|
|
|
unitList,
|
|
unitList,
|
|
|
|
|
|