|
|
@@ -418,6 +418,7 @@ import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
|
|
|
import { handleAccountManager } from '../setup';
|
|
|
import { Moment } from 'moment';
|
|
|
import { handleFormRule, handleContract, handleDeliveryGoods, handleAmout, handlePrice, handleDate, handleFromState } from '../setup';
|
|
|
+import {addContractReq} from "@/views/information/spot-contract/components/add/setup";
|
|
|
|
|
|
interface Obj {
|
|
|
[props: string]: any;
|
|
|
@@ -434,6 +435,7 @@ export default defineComponent({
|
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = closeModal('spot_contract_btn_modify');
|
|
|
const loading = ref<boolean>(false);
|
|
|
+ const { sendReq } = addContractReq();
|
|
|
const { formState, businessType } = handleFromState();
|
|
|
console.log('props.selectedRow', props.selectedRow);
|
|
|
|
|
|
@@ -475,7 +477,45 @@ export default defineComponent({
|
|
|
props.selectedRow.deliverygoodsid && deliveryGoodsChange(props.selectedRow.deliverygoodsid);
|
|
|
}
|
|
|
});
|
|
|
- function submit() {}
|
|
|
+ function submit() {
|
|
|
+ formRef.value
|
|
|
+ .validate()
|
|
|
+ .then(() => {
|
|
|
+ const param = toRaw(formState);
|
|
|
+ const id = getUsrId();
|
|
|
+ isSell.value ? (param.SellUserID = id) : (param.BuyUserID = id);
|
|
|
+ const fn = (value: Moment) => {
|
|
|
+ return formatTime(value, 'd') + ' ' + '00:00:00';
|
|
|
+ };
|
|
|
+ // 交收期
|
|
|
+ const dDate = deliveryDate.value;
|
|
|
+ if (dDate.length) {
|
|
|
+ const DeliveryStartDate = fn(dDate[0]);
|
|
|
+ const DeliveryEndDate = fn(dDate[1]);
|
|
|
+ Object.assign(param, { DeliveryStartDate, DeliveryEndDate });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 点价期
|
|
|
+ const pDate = priceDate.value;
|
|
|
+ if (pDate.length && param.PriceType !== 1) {
|
|
|
+ // 点价日期[2:点价3:暂定价]
|
|
|
+ const StartDate = fn(pDate[0]);
|
|
|
+ const EndDate = fn(pDate[1]);
|
|
|
+ Object.assign(param, { StartDate, EndDate });
|
|
|
+ }
|
|
|
+ console.log('values', formState);
|
|
|
+
|
|
|
+ sendReq(param, loading, 2)
|
|
|
+ .then((res) => {
|
|
|
+ context.emit('refresh');
|
|
|
+ cancel();
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
+ })
|
|
|
+ .catch((error: ValidateErrorEntity<FormState>) => {
|
|
|
+ console.log('error', error);
|
|
|
+ });
|
|
|
+ }
|
|
|
initData(() => {
|
|
|
queryCustomList();
|
|
|
getDeliveryGoods();
|