li.shaoyi 3 år sedan
förälder
incheckning
f99f1f337f

+ 8 - 2
src/views/information/spot-contract/components/add/index.vue

@@ -349,7 +349,13 @@ export default defineComponent({
       console.log(formState)
       validateAction<FormState>(formRef, formState).then((param) => {
         const id = getUserId();
-        isSell.value ? (param.SellUserID = id) : (param.BuyUserID = id);
+        if (isSell.value) {
+          param.SellUserID = id;
+        } else {
+          param.SellUserID = param.BuyUserID;
+          param.BuyUserID = id;
+        }
+
         const fn = (value: Moment) => {
           return formatTime(value, 'd') + ' ' + '00:00:00';
         };
@@ -369,7 +375,7 @@ export default defineComponent({
           const EndDate = fn(pDate[1]);
           Object.assign(param, { StartDate, EndDate });
         }
-        param.SellUserID = param.BuyUserID;
+
         // 合同附件
         param.ContractAttachment = getFirstImg();
         sendReq(param, loading, OperateType)

+ 2 - 3
src/views/information/spot-contract/components/common-detail/index.vue

@@ -65,11 +65,10 @@ export default defineComponent({
           { label: '合同编号', value: formatValue(data.contractno) },
           { label: '合同类型', value: getContractTypeName(data.contracttype) },
           { label: '业务类型', value: getBizTypeName(data.biztype) },
-          { label: '采购方', value: formatValue(data.buyusername) },
-          { label: '销售方', value: formatValue(data.sellusername) },
+          { label: data.contracttype === 1 ? '销售方' : '采购方', value: formatValue(data.contracttype === 1 ? data.sellusername : data.buyusername) },
+          { label: data.contracttype === 1 ? '采购方' : '销售方', value: formatValue(data.subjectname) },
           { label: '合同附件', value: formatValue(getImgName(data.attachment)) },
           { label: '状态', value: getContractStatusName(data.contracctstatus), className: 'green' },
-          //{ label: "交易主体", value: formatValue(data.subjectname) }
         ];
         getBaseInfo(base);
         // 现货信息