Jelajahi Sumber

修改formatTime

huangbin 4 tahun lalu
induk
melakukan
c52a570249

+ 2 - 2
src/common/methods/format/index.ts

@@ -67,9 +67,9 @@ type TIME = 's' | 'm' | 'd'
 export function formatTime(value: string | Date, type: TIME) {
     let str = 'YYYY-MM-DD HH:mm:ss';
     if (type === 'd') {
-        str = 'YYYY-MM-DD HH:mm'
+        str = 'YYYY-MM-DD'
     } else if (type === 'm') {
-        'YYYY-MM-DD'
+        'YYYY-MM-DD HH:mm'
     }
     if (value) return moment(value).format(str);
     return value;

+ 189 - 189
src/views/information/spot-contract/components/detail/index.vue

@@ -1,196 +1,196 @@
 <template>
-    <!-- 现货合同详情-->
-    <a-modal class="add-custom custom-detail"
-             title="现货合同详情"
-             v-model:visible="visible"
-             @cancel="cancel"
-             width="890px">
-        <template #footer>
-            <a-button key="submit"
-                      type="primary"
-                      :loading="loading"
-                      @click="submit">关闭</a-button>
-        </template>
-        <a class="white">
-            基本信息
-        </a>
-        <a-form class="inlineForm"
-                :form="form"
-                @submit="handleSearch">
-            <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="white">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</span>
-                    </a-form-item>
-                </a-col>
-            </a-row>
-        </a-form>
-        <a class="white">
-            现货信息
-        </a>
-        <a-form class="inlineForm"
-                :form="form"
-                @submit="handleSearch">
-            <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>
-        </a-form>
-        <a class="white">
-            价格信息
-        </a>
-        <a-form class="inlineForm"
-                :form="form"
-                @submit="handleSearch">
-            <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>
-        </a-form>
-        <a class="white">
-            其它信息
-        </a>
-        <a-form class="inlineForm"
-                :form="form"
-                @submit="handleSearch">
-            <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="期货账户">
-                        <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-row>
-        </a-form>
-    </a-modal>
+  <!-- 现货合同详情-->
+  <a-modal class="add-custom custom-detail"
+           title="现货合同详情"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+    <a class="white">
+      基本信息
+    </a>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <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="white">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+    <a class="white">
+      现货信息
+    </a>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <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>
+    </a-form>
+    <a class="white">
+      价格信息
+    </a>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <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>
+    </a-form>
+    <a class="white">
+      其它信息
+    </a>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <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="期货账户">
+            <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-row>
+    </a-form>
+  </a-modal>
 </template>
 
 <script lang="ts">
-import {defineComponent, PropType, reactive, ref} from 'vue';
+import { defineComponent, PropType, reactive, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import {QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
-import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
-import {getStatusName} from "@/views/information/custom/setup";
-import {getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
-import {formatValue, formatTime} from "@/common/methods/format";
+import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
+import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+import { getStatusName } from '@/views/information/custom/setup';
+import { getContractStatusName, getPriceTypeName } from '@/views/information/spot-contract/setup';
+import { formatValue, formatTime } from '@/common/methods/format';
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -219,7 +219,7 @@ export default defineComponent({
             formatValue,
             getContractStatusName,
             getPriceTypeName,
-            formatTime
+            formatTime,
         };
     },
 });