Browse Source

修改合同提交

li.shaoyi 3 years ago
parent
commit
a760c16169

+ 30 - 20
src/views/information/spot-contract/components/add/index.vue

@@ -40,16 +40,30 @@
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item :label="isSell ? '采购方' : '销售方'" name="BuyUserID">
-              <a-select class="inlineFormSelect" style="width: 200px"
-                :getPopupContainer="(triggerNode) => triggerNode.parentNode" v-model:value="formState.BuyUserID"
-                placeholder="请选择客户">
-                <!-- 客户资料列表 正常 -->
-                <a-select-option :value="item.userid" v-for="item in customList" :key="item.userid">
-                  {{ item.customername }}
-                </a-select-option>
-              </a-select>
-            </a-form-item>
+            <template v-if="isSell">
+              <a-form-item label="采购方" name="BuyUserID">
+                <a-select class="inlineFormSelect" style="width: 200px"
+                  :getPopupContainer="(triggerNode) => triggerNode.parentNode" v-model:value="formState.BuyUserID"
+                  placeholder="请选择客户">
+                  <!-- 客户资料列表 -->
+                  <a-select-option :value="item.userid" v-for="item in customList" :key="item.userid">
+                    {{ item.customername }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </template>
+            <template v-else>
+              <a-form-item label="销售方" name="SellUserID">
+                <a-select class="inlineFormSelect" style="width: 200px"
+                  :getPopupContainer="(triggerNode) => triggerNode.parentNode" v-model:value="formState.SellUserID"
+                  placeholder="请选择客户">
+                  <!-- 客户资料列表 -->
+                  <a-select-option :value="item.userid" v-for="item in customList" :key="item.userid">
+                    {{ item.customername }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </template>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
             <a-form-item label="合同附件" class="checkboxGroupItem" name="ContractAttachment">
             <a-form-item label="合同附件" class="checkboxGroupItem" name="ContractAttachment">
@@ -222,7 +236,7 @@
         <legend>其他信息</legend>
         <legend>其他信息</legend>
         <a-row :gutter="24">
         <a-row :gutter="24">
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="初始保证金" name="ContractMargin">
+            <a-form-item label="保证金" name="ContractMargin">
               <a-input class="dialogInput suffixGrey" placeholder="请输入保证金" v-model:value="formState.ContractMargin"
               <a-input class="dialogInput suffixGrey" placeholder="请输入保证金" v-model:value="formState.ContractMargin"
                 style="width: 200px" :suffix="payCurrencyUnit" />
                 style="width: 200px" :suffix="payCurrencyUnit" />
             </a-form-item>
             </a-form-item>
@@ -349,16 +363,12 @@ export default defineComponent({
       console.log(formState)
       console.log(formState)
       validateAction<FormState>(formRef, formState).then((param) => {
       validateAction<FormState>(formRef, formState).then((param) => {
         const id = getUserId();
         const id = getUserId();
-        if (isSell.value) {
-          param.SellUserID = id;
-        } else {
-          param.SellUserID = param.BuyUserID;
-          param.BuyUserID = id;
-        }
+        isSell.value ? (param.SellUserID = id) : (param.BuyUserID = id);
 
 
         const fn = (value: Moment) => {
         const fn = (value: Moment) => {
           return formatTime(value, 'd') + ' ' + '00:00:00';
           return formatTime(value, 'd') + ' ' + '00:00:00';
         };
         };
+
         // 交收期
         // 交收期
         const dDate = deliveryDate.value;
         const dDate = deliveryDate.value;
         if (dDate.length) {
         if (dDate.length) {
@@ -440,9 +450,9 @@ export default defineComponent({
       getRootUserInfo,
       getRootUserInfo,
       subjectList,
       subjectList,
       getContractTypeName,
       getContractTypeName,
-    };
-  },
-});
+    }
+  }
+})
 </script>
 </script>
 
 
 <style lang="less">
 <style lang="less">

+ 26 - 37
src/views/information/spot-contract/components/modify/index.vue

@@ -3,7 +3,7 @@
   <a-modal class="commonModal modify-custom" title="重新提交现货合同" v-if="visible" v-model:visible="visible" @cancel="cancel"
   <a-modal class="commonModal modify-custom" title="重新提交现货合同" v-if="visible" v-model:visible="visible" @cancel="cancel"
     centered width="890px">
     centered width="890px">
     <template #footer>
     <template #footer>
-      <a-button key="submit" type="primary" :loading="loading" :disabled="loading" @click="submit">完成</a-button>
+      <a-button key="submit" type="primary" :loading="loading" :disabled="loading" @click="submit">提交审核</a-button>
     </template>
     </template>
     <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
     <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
       <fieldset class="formFieldSet">
       <fieldset class="formFieldSet">
@@ -16,16 +16,11 @@
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="合同类型" name="ContractType">
-              <a-select class="inlineFormSelect" style="width: 200px" @change="contractChange"
-                v-model:value="formState.ContractType" placeholder="请选择合同类型">
-                <a-select-option v-for="item in contractType" :key="item.key" :value="item.key">
-                  {{ item.value }}
-                </a-select-option>
-              </a-select>
+            <a-form-item label="合同类型">
+              <span class="white">{{ getContractTypeName(formState.ContractType) }}</span>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
-          <a-col :span="12">
+          <a-col :span="12" v-if="false">
             <a-form-item label="业务类型" name="BizType">
             <a-form-item label="业务类型" name="BizType">
               <a-select class="inlineFormSelect" style="width: 200px" v-model:value="formState.BizType"
               <a-select class="inlineFormSelect" style="width: 200px" v-model:value="formState.BizType"
                 placeholder="请选择业务类型">
                 placeholder="请选择业务类型">
@@ -35,49 +30,39 @@
               </a-select>
               </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
-          <template v-if="isSell">
-            <a-col :span="12">
+          <a-col :span="12">
+            <template v-if="isSell">
               <a-form-item label="采购方" name="BuyUserID">
               <a-form-item label="采购方" name="BuyUserID">
-                <a-select class="inlineFormSelect" style="width: 200px" v-model:value="formState.BuyUserID"
+                <a-select class="inlineFormSelect" style="width: 200px"
+                  :getPopupContainer="(triggerNode) => triggerNode.parentNode" v-model:value="formState.BuyUserID"
                   placeholder="请选择客户">
                   placeholder="请选择客户">
-                  <!-- 客户资料列表 正常 -->
+                  <!-- 客户资料列表 -->
                   <a-select-option :value="item.userid" v-for="item in customList" :key="item.userid">
                   <a-select-option :value="item.userid" v-for="item in customList" :key="item.userid">
                     {{ item.customername }}
                     {{ item.customername }}
                   </a-select-option>
                   </a-select-option>
                 </a-select>
                 </a-select>
               </a-form-item>
               </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item label="销售方">
-                <span class="white">{{ getUserName() }}</span>
-              </a-form-item>
-            </a-col>
-          </template>
-          <template v-else>
-            <a-col :span="12">
-              <a-form-item label="采购方">
-                <span class="white">{{ getUserName() }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">
+            </template>
+            <template v-else>
               <a-form-item label="销售方" name="SellUserID">
               <a-form-item label="销售方" name="SellUserID">
-                <a-select class="inlineFormSelect" v-model:value="formState.SellUserID" style="width: 200px"
+                <a-select class="inlineFormSelect" style="width: 200px"
+                  :getPopupContainer="(triggerNode) => triggerNode.parentNode" v-model:value="formState.SellUserID"
                   placeholder="请选择客户">
                   placeholder="请选择客户">
-                  <!-- 客户资料列表 正常 -->
+                  <!-- 客户资料列表 -->
                   <a-select-option :value="item.userid" v-for="item in customList" :key="item.userid">
                   <a-select-option :value="item.userid" v-for="item in customList" :key="item.userid">
                     {{ item.customername }}
                     {{ item.customername }}
                   </a-select-option>
                   </a-select-option>
                 </a-select>
                 </a-select>
               </a-form-item>
               </a-form-item>
-            </a-col>
-          </template>
+            </template>
+          </a-col>
           <a-col :span="12">
           <a-col :span="12">
             <a-form-item label="合同附件" name="ContractAttachment">
             <a-form-item label="合同附件" name="ContractAttachment">
               <UploadImg :visible="visible" :imgList="uploadImgList" @upload="uploadImgAction" />
               <UploadImg :visible="visible" :imgList="uploadImgList" @upload="uploadImgAction" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="交易主体" name="SubjectID">
+            <a-form-item :label="isSell ? '销售方' : '采购方'" name="SubjectID">
               <a-select class="inlineFormSelect" style="width: 200px" v-model:value="formState.SubjectID"
               <a-select class="inlineFormSelect" style="width: 200px" v-model:value="formState.SubjectID"
                 placeholder="请选择主体">
                 placeholder="请选择主体">
                 <a-select-option :value="item.subjectid" v-for="item in subjectList" :key="item.subjectid">
                 <a-select-option :value="item.subjectid" v-for="item in subjectList" :key="item.subjectid">
@@ -123,7 +108,7 @@
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="商品规格" name="SpotGoodsDesc">
+            <a-form-item label="商品规格">
               <a-input class="dialogInput" style="width: 200px" v-model:value="formState.SpotGoodsDesc"
               <a-input class="dialogInput" style="width: 200px" v-model:value="formState.SpotGoodsDesc"
                 placeholder="请输入商品规格" />
                 placeholder="请输入商品规格" />
             </a-form-item>
             </a-form-item>
@@ -260,7 +245,7 @@
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="交易用户" name="TradeUserID">
+            <a-form-item label="交易用户" name="TradeUserID" v-if="false">
               <a-select class="inlineFormSelect" style="width: 200px" v-model:value="formState.TradeUserID"
               <a-select class="inlineFormSelect" style="width: 200px" v-model:value="formState.TradeUserID"
                 placeholder="请选择期货账户">
                 placeholder="请选择期货账户">
                 <a-select-option v-for="item in traderList" :key="item.roleid" :value="item.roleid">
                 <a-select-option v-for="item in traderList" :key="item.roleid" :value="item.roleid">
@@ -293,6 +278,7 @@ import { handlerManagerList } from '@/common/setup/user';
 import { getUploadImg } from '@/common/setup/upload';
 import { getUploadImg } from '@/common/setup/upload';
 import UploadImg from '@/common/components/uploadImg/index.vue';
 import UploadImg from '@/common/components/uploadImg/index.vue';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { _closeModal } from '@/common/setup/modal/modal';
+import { getContractTypeName } from '@/common/constants/enumsName';
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'spot_contract_btn_modify',
   name: 'spot_contract_btn_modify',
@@ -405,9 +391,11 @@ export default defineComponent({
       validateAction<FormState>(formRef, formState).then((param) => {
       validateAction<FormState>(formRef, formState).then((param) => {
         const id = getUserId();
         const id = getUserId();
         isSell.value ? (param.SellUserID = id) : (param.BuyUserID = id);
         isSell.value ? (param.SellUserID = id) : (param.BuyUserID = id);
+
         const fn = (value: Moment) => {
         const fn = (value: Moment) => {
           return formatTime(value, 'd') + ' ' + '00:00:00';
           return formatTime(value, 'd') + ' ' + '00:00:00';
         };
         };
+
         // 交收期
         // 交收期
         const dDate = deliveryDate.value;
         const dDate = deliveryDate.value;
         if (dDate.length) {
         if (dDate.length) {
@@ -479,7 +467,8 @@ export default defineComponent({
       uploadImgAction,
       uploadImgAction,
       uploadImgList,
       uploadImgList,
       subjectList,
       subjectList,
-    };
-  },
-});
+      getContractTypeName,
+    }
+  }
+})
 </script>
 </script>