Forráskód Böngészése

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 éve
szülő
commit
d3019b2080

+ 10 - 5
src/App.vue

@@ -1,11 +1,14 @@
 <template>
   <div class="app-container"
        @contextmenu.prevent>
-    <a-spin :tip="tip"
-            :spinning="spinning"
-            size="large">
-      <router-view />
-    </a-spin>
+    <!-- 中文配置 -->
+    <a-config-provider :locale="zhCN">
+      <a-spin :tip="tip"
+              :spinning="spinning"
+              size="large">
+        <router-view />
+      </a-spin>
+    </a-config-provider>
   </div>
 </template>
 
@@ -20,6 +23,7 @@ import APP from '@/services';
 import { Modal } from 'ant-design-vue';
 import { setLoadComplete } from '@/common/methods';
 import { isLogin, logout } from '@/services/bus/login';
+import zhCN from 'ant-design-vue/es/locale/zh_CN';
 let lastTime = new Date().getTime();
 
 function logoutAction() {
@@ -123,6 +127,7 @@ export default defineComponent({
         return {
             tip,
             spinning,
+            zhCN,
         };
     },
 });

+ 1 - 1
src/services/bus/index.ts

@@ -34,7 +34,7 @@ export async function globalDataRefresh(): Promise<string> {
             } else {
                 // token校验成功 马上轮询
                 checkTokenLoop();
-                Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), LoginQuery()])
+                await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), LoginQuery()])
             }
         } else {
             // 重置数据中心数据

+ 1 - 1
src/services/bus/login.ts

@@ -25,7 +25,7 @@ export const login = async (logidCode: string, password: String, byteArr: Uint8A
 
         // localstorage 缓存登录信息,处理页面刷新
         setLoginData(loginData);
-        Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), getServerTime(), LoginQuery()])
+        await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), getServerTime(), LoginQuery()])
         // await GetPCMenus();
         // await QueryTableDefine();
         // 获取服务时间

+ 22 - 36
src/views/information/spot-contract/components/add/index.vue

@@ -231,8 +231,7 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="数量"
-                         name="Qty"
-                         >
+                         name="Qty">
               <a-input class="dialogInput suffixGrey"
                        v-model:value="formState.Qty"
                        style="width: 200px"
@@ -266,8 +265,10 @@
               </a-form-item>
             </a-col>
             <a-col :span="12">
-              <a-form-item label="升贴水">
+              <a-form-item label="升贴水"
+                           name="PriceMove">
                 <a-input class="dialogInput suffixGrey"
+                         v-model:value="formState.PriceMove"
                          placeholder="请输入升贴水"
                          :suffix="`${payCurrencyUnit}/${numberUnit}`"
                          style="width: 200px" />
@@ -275,40 +276,20 @@
             </a-col>
             <a-col :span="12">
               <a-form-item label="点价期">
-                <a-select class="inlineFormSelect"
-                          style="width: 95px"
-                          placeholder="请选择点价期">
-                  <a-select-option value="1">
-                    日期一
-                  </a-select-option>
-                </a-select>
-                <span class="to">-</span>
-                <a-select class="inlineFormSelect"
-                          style="width: 95px"
-                          placeholder="请选择定价类型">
-                  <a-select-option value="1">
-                    日期二
-                  </a-select-option>
-                </a-select>
+                <a-range-picker v-model:value="priceDate"
+                                class="commonPicker"
+                                :disabled-date="disabledDate"
+                                :show-time="{hideDisabledOptions: true}"
+                                format="YYYY-MM-DD" />
               </a-form-item>
             </a-col>
             <a-col :span="12">
               <a-form-item label="交收期">
-                <a-select class="inlineFormSelect"
-                          style="width: 95px"
-                          placeholder="请选择定价类型">
-                  <a-select-option value="1">
-                    日期一
-                  </a-select-option>
-                </a-select>
-                <span class="to">-</span>
-                <a-select class="inlineFormSelect"
-                          style="width: 95px"
-                          placeholder="请选择定价类型">
-                  <a-select-option value="1">
-                    日期二
-                  </a-select-option>
-                </a-select>
+                <a-range-picker v-model:value="deliveryDate"
+                                class="commonPicker"
+                                :disabled-date="disabledDate"
+                                :show-time="{hideDisabledOptions: true}"
+                                format="YYYY-MM-DD" />
               </a-form-item>
             </a-col>
           </template>
@@ -438,6 +419,7 @@ import { initData } from '@/common/methods';
 import { handleFromState, handleContract, handlevalidate, handleDeliveryGoods, handlePrice, handleDate } from './setup';
 import { getUserName } from '@/services/bus/user';
 import { getGoodsList } from '@/services/bus/goods';
+import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
 
 export default defineComponent({
     name: 'add-spot-contract',
@@ -452,7 +434,7 @@ export default defineComponent({
         // 合同类型
         const { contractType, isSell, contractChange, customList, queryCustomList } = handleContract();
         // 自定义表单验证方法
-        const { v_ContractType, v_BizType, v_BuyUser, v_SellUser, v_DeliveryGoods, v_WrStandard, v_SpotGoodsBrand, v_PriceType, v_Currency } = handlevalidate(formState);
+        const { v_ContractType, v_BizType, v_BuyUser, v_SellUser, v_DeliveryGoods, v_WrStandard, v_SpotGoodsBrand, v_PriceType, v_Currency, v_Goods } = handlevalidate(formState);
         const rules = {
             ContractNo: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
             ContractType: [{ required: true, validator: v_ContractType, trigger: 'change' }],
@@ -462,21 +444,23 @@ export default defineComponent({
             DeliveryGoodsID: [{ required: true, validator: v_DeliveryGoods, trigger: 'change' }],
             WrStandardID: [{ required: true, validator: v_WrStandard, trigger: 'blur' }],
             SpotGoodsBrandID: [{ required: true, validator: v_SpotGoodsBrand, trigger: 'blur' }],
+            GoodsID: [{ required: true, validator: v_Goods, trigger: 'blur' }],
             ConvertFactor: [{ required: true, message: '请选择品类', trigger: 'blur' }],
             SpotGoodsDesc: [{ required: true, message: '请输入商品规格', trigger: 'blur' }],
             PriceType: [{ required: true, validator: v_PriceType, trigger: 'blur' }],
             CurrencyID: [{ required: true, validator: v_Currency, trigger: 'blur' }],
             Qty: [{ required: true, message: '请输入数量', trigger: 'blur' }],
             Price: [{ required: true, message: '请输入价格', trigger: 'blur' }],
+            PriceMove: [{ required: true, message: '请输入升贴水', trigger: 'blur' }],
         };
         //  处理现货商品
         const { deliveryGoodsList, gblist, gmlist, numberUnit, WrStandardChange, getDeliveryGoods, deliveryGoodsChange } = handleDeliveryGoods(formState);
         // 价格信息
         const { priceType, payCurrency, payCurrencyUnit, parCurrencyChange } = handlePrice(formState);
         // 日期
-        const { deliveryDate, disabledDate } = handleDate();
+        const { deliveryDate, priceDate, disabledDate } = handleDate();
         // 现货商品列表
-        const goodsList = getGoodsList();
+        const goodsList = ref<Goods[]>([]);
         function submit() {
             loading.value = true;
             setTimeout(() => {
@@ -487,6 +471,7 @@ export default defineComponent({
         initData(() => {
             queryCustomList();
             getDeliveryGoods();
+            goodsList.value = getGoodsList();
         });
         return {
             visible,
@@ -513,6 +498,7 @@ export default defineComponent({
             numberUnit,
             getUserName,
             deliveryDate,
+            priceDate,
             disabledDate,
             goodsList,
         };

+ 1 - 0
src/views/information/spot-contract/components/add/interface.ts

@@ -19,6 +19,7 @@ export interface FormState {
     Amount: number | null// double 金额[1:一口价、3:暂定价]
     DeliveryStartDate: string// string 交收期(开始)
     DeliveryEndDate: string // string 交收期(结束)
+    PriceMove: number | null// double 升贴水[2:点价3:暂定价]
     GoodsID: number | undefined // uint64 点价合约ID-0:为现货,其它为期货商品合约ID[2:点价3:暂定价]
     // PriceMove: number// double 升贴水[2:点价3:暂定价]
     // StartDate: string // string 点价开始日期[2:点价3:暂定价]

+ 10 - 3
src/views/information/spot-contract/components/add/setup.ts

@@ -36,6 +36,7 @@ export function handleFromState() {
         Remark: '', // string 合同备注
         CurrencyID: undefined, // 结算币种ID
         GoodsID: undefined, // uint64 点价合约ID-0:为现货,其它为期货商品合约ID[2:点价3:暂定价]
+        PriceMove: null// double 升贴水[2:点价3:暂定价]
     })
     // 业务类型
     const businessType = [
@@ -116,10 +117,13 @@ export function handlevalidate(formState: UnwrapRef<FormState>) {
     async function v_Currency(rule: RuleObject, value: number) {
         return validateCommon(value, '请选择结算币种')
     }
-
+    // 验证点价合约
+    async function v_Goods(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择点价合约')
+    }
     return {
         v_ContractType, v_BizType, v_BuyUser, v_SellUser, v_DeliveryGoods, v_WrStandard,
-        v_SpotGoodsBrand, v_PriceType, v_Currency
+        v_SpotGoodsBrand, v_PriceType, v_Currency, v_Goods
     }
 }
 
@@ -216,10 +220,13 @@ export function handleAddAction() {
  * 处理日期
  */
 export function handleDate() {
+    // 交收期
     const deliveryDate = ref<Moment[]>([])
+    // 点价期
+    const priceDate = ref<Moment[]>([]);
     function disabledDate(current: Moment) {
         // Can not select days before today and today
         return current && current < moment().endOf('day');
     }
-    return { deliveryDate, disabledDate }
+    return { deliveryDate, priceDate, disabledDate }
 }