Sfoglia il codice sorgente

commit 现货合同

xkwg 4 anni fa
parent
commit
ac3dcca451

+ 196 - 165
src/views/information/spot-contract/components/finish/index.vue

@@ -16,190 +16,221 @@
                 :loading="loading"
                 @click="submit">确认完结</a-button>
     </template>
-    <a-form class="inlineForm">
-      <fieldset class="formFieldSet">
-        <legend>基本信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="合同编号">
-              <span class="white">NPCQ-2020121001</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同类型">
-              <span class="white">采购合同</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="业务类型">
-              <span class="white">套保</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="采购方">
-                <span class="white">河北石家庄刚强矿石公司</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="销售方">
-             <span class="white">菏泽已成钢材有限公司</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同附件">
-                <div class="upload">
-                    <div class="look">查看附件</div>
-                </div>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="状态">
-             <span class="green">正常</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-      <fieldset class="formFieldSet">
-        <legend>现货信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="现货品种">
-              <span class="white">螺纹钢12</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="品类">
-              <span class="white">10mm</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="品牌">
-              <span class="white">江铜</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="标仓系数">
-                <span class="white">1.1</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="商品规格">
-              <span class="white">符合国际GB/T1196-2008AL99.70规定,其中铝含量不低于99.7%</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-      <fieldset class="formFieldSet">
-        <legend>价格信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="定价类型">
-              <span class="white">点价</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="数量">
-              <span class="white">菏泽已成钢材有限公司</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价合约">
-              <span class="white">CU2011</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="升贴水">
-              <span class="white">100元/吨</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价期">
-              <span class="white">2020-12-10~2021-02-10</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="交收期">
-              <span class="white">2020-12-10~2021-02-10</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-      <fieldset class="formFieldSet">
-        <legend>其他信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="保证金">
-              <span class="white">13700元</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="业务员">
-              <span class="white">李顺利(lishunli)</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="跟单员">
-              <span class="white">王平(wangping)</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="期货账户">
-                <span class="white">25000000001</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="备注">
-              <span class="white">符合国际GB/T1196-2008AL99.70规定,其中铝含量不低于99.7%</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-    </a-form>
+      <a-form class="inlineForm"
+              :form="form"
+              @submit="handleSearch">
+          <fieldset class="formFieldSet">
+              <legend>基本信息</legend>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="合同编号">
+                          <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同类型">
+                          <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="业务类型">
+                          <span class="white">{{ formatValue(selectedRow.biztype) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="采购方">
+                          <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="销售方">
+                          <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同附件">
+                          <span class="white">{{ formatValue(selectedRow.contracctstatus) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="状态">
+                          <span class="yellow">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </fieldset>
+          <fieldset class="formFieldSet">
+              <legend>现货信息</legend>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="现货品种">
+                          <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="品类">
+                          <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="品牌">
+                          <span class="white">{{ formatValue(selectedRow.brandname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="标仓系数">
+                          <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="商品规格">
+                          <span class="white">{{ formatValue(selectedRow.spotgoodsdesc) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </fieldset>
+          <fieldset class="formFieldSet">
+              <legend>价格信息</legend>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="定价类型">
+                          <span class="white">{{ getPriceTypeName(formatValue(selectedRow.pricetype)) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="数量">
+                          <span class="white">{{ formatValue(selectedRow.qty) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="点价合约">
+                          <span class="white">{{ formatValue(selectedRow.goodscode) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="升贴水">
+                          <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="点价期">
+                          <span class="white">{{ formatValue(formatTime(selectedRow.startdate, "d") + '--' + formatTime(selectedRow.enddate, "d")) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="交收期">
+                          <span class="white">{{ formatValue(formatTime(selectedRow.deliverystartdate, "d") + '--' + formatTime(selectedRow.deliveryenddate, "d"))}}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </fieldset>
+          <fieldset class="formFieldSet">
+              <legend>其它信息</legend>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="保证金">
+                          <span class="white">{{ formatValue(selectedRow.contractmargin) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="业务员">
+                          <span class="white">{{ formatValue(selectedRow.saleuserlogincode) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="跟单员">
+                          <span class="white">{{ formatValue(selectedRow.meruserlogincode) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="期货账户">
+                          <span class="white">{{ formatValue(selectedRow.accountid) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="备注">
+                          <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </fieldset>
+      </a-form>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {formatTime, formatValue} from "@/common/methods";
+import {getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
+import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
+import {deleteOrderContract} from "@/views/information/spot-contract/components/setup";
+import {message, Modal} from "ant-design-vue";
 
 export default defineComponent({
     name: 'spot-contract-detail',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_finish');
-        const loading = ref<boolean>(false);
+        const {loading, orderContractState} = deleteOrderContract()
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            Modal.confirm({
+                title: '是否确认完结',
+                okText: '确认完结',
+                cancelText: '取消',
+                onOk() {
+                    // 删除客户资料
+                    orderContractState(props.selectedRow.spotcontractid)
+                        .then(res => {
+                            message.success(res);
+                            // 通知上层  刷新数据
+                            context.emit('refresh');
+                            cancel();
+                        }).catch(err => {
+                        message.error(err);
+                    });
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,
             cancel,
             submit,
             loading,
-            maskClosableFlag
+            maskClosableFlag,
+            formatValue,
+            getPriceTypeName,
+            getContractStatusName,
+            formatTime,
         };
     },
 });

+ 2 - 1
src/views/information/spot-contract/components/setup.ts

@@ -3,6 +3,7 @@ import {orderContract} from "@/services/proto/spotcontract";
 import {ref} from "vue";
 import {getSelectedAccountId} from "@/services/bus/account";
 
+
 /**
  * 删除未提交合同 // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
  */
@@ -12,7 +13,7 @@ export function deleteOrderContract(){
     function orderContractState(id: string): Promise<string>{
         const reqs : GldErmcpSpotContractOperateReq = {
             SpotContractID: Number(id),
-            OperateType: 5,
+            OperateType: 6,
             Remark: '',
         }
        return orderContract(reqs)

+ 1 - 1
src/views/information/spot-contract/list/finished/index.vue

@@ -36,7 +36,7 @@
     <!-- 新增现货合同 -->
     <AddSpotContract />
     <!-- 现货合同: 详情 -->
-    <SpotContractDeatil :selectedRow="selectedRow" />
+    <SpotContractDeatil :selectedRow="selectedRow" @refresh="queryTable"/>
   </div>
 </template>
 

+ 2 - 2
src/views/information/spot-contract/list/performance/index.vue

@@ -34,9 +34,9 @@
       </a-table>
     </contextMenu>
     <!-- 现货合同: 详情 -->
-    <SpotContractDeatil :selectedRow="selectedRow" />
+    <SpotContractDeatil :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 现货合同: 正常完结 -->
-    <Finish />
+    <Finish :selectedRow="selectedRow" @refresh="queryTable"/>
   </div>
 </template>