huangbin 4 anni fa
parent
commit
040f57ba37

+ 9 - 0
src/services/bus/user.ts

@@ -0,0 +1,9 @@
+import APP from '@/services';
+
+/**
+ * 获取用户账户类型
+ * @returns 
+ */
+export function getUserAccountType() {
+    return APP.get('userAccount').usertype
+}

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

@@ -12,7 +12,7 @@ const needClearSourceData: NeedClearSourceDataType = {
     loginAccount: new LoginaccountModel(),
     markets: [],
     systemParams: [], // 系统参数
-    userAccount: new userAccountModel(),
+    userAccount: new userAccountModel(), // 用户账号信息
     userInfo: new UserInfoModel(), // 用户信息
     username: '',
     menus: [],

+ 5 - 5
src/services/request/serviceURL.ts

@@ -73,10 +73,10 @@ export const commonSearchUrl = (url: string): string => {
 export const setServiceURL = (config: URL): void => {
     console.log('URL', config);
     // 外网环境(175),外包同事使用
-    // if (process.env.NODE_ENV === 'development') {
-    //     serviceURL.goCommonSearchUrl = 'http://218.17.158.45:21001/api';
-    //     serviceURL.quoteUrl = 'ws://218.17.158.45:21004';
-    //     serviceURL.tradeUrl = 'ws://218.17.158.45:21005';
-    // }
+    if (process.env.NODE_ENV === 'development') {
+        serviceURL.goCommonSearchUrl = 'http://218.17.158.45:21001/api';
+        serviceURL.quoteUrl = 'ws://218.17.158.45:21004';
+        serviceURL.tradeUrl = 'ws://218.17.158.45:21005';
+    }
     serviceURL = config;
 };

+ 65 - 33
src/views/information/spot-contract/components/add/index.vue

@@ -16,15 +16,18 @@
                 :loading="loading"
                 @click="submit">提交审核</a-button>
     </template>
-    <a-form class="inlineForm">
+    <a-form class="inlineForm"
+            ref="formRef"
+            :model="formState"
+            :rules="rules">
       <fieldset class="formFieldSet">
         <legend>基本信息</legend>
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="合同编号">
               <a-input class="dialogInput"
-                      style="width: 200px"
-                      placeholder="请输入合同编号" />
+                       style="width: 200px"
+                       placeholder="请输入合同编号" />
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -59,11 +62,11 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="采购方">
-                <span class="white">河北石家庄刚强矿石公司</span>
+              <span class="white">河北石家庄刚强矿石公司</span>
             </a-form-item>
           </a-col>
-      </a-row>
-      <a-row :gutter="24">
+        </a-row>
+        <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="销售方">
               <a-select class="inlineFormSelect"
@@ -80,13 +83,13 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同附件">
-                <div class="upload">
-                    <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                                :transform-file="transformFile">
-                        <a-button class="uploadBtn">上传</a-button>
-                    </a-upload>
-                    <div class="look">查看附件</div>
-                </div>
+              <div class="upload">
+                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                          :transform-file="transformFile">
+                  <a-button class="uploadBtn">上传</a-button>
+                </a-upload>
+                <div class="look">查看附件</div>
+              </div>
             </a-form-item>
           </a-col>
         </a-row>
@@ -140,16 +143,16 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="标仓系数">
-                <span class="white">输入数量和价格后自动算</span>
+              <span class="white">输入数量和价格后自动算</span>
             </a-form-item>
           </a-col>
-      </a-row>
-      <a-row :gutter="24">
+        </a-row>
+        <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="商品规格">
               <a-input class="dialogInput"
-                      style="width: 200px"
-                      placeholder="请输入商品规格" />
+                       style="width: 200px"
+                       placeholder="请输入商品规格" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -173,7 +176,9 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="数量">
-              <a-input class="dialogInput suffixGrey" placeholder="请输入数量" suffix="单位" />
+              <a-input class="dialogInput suffixGrey"
+                       placeholder="请输入数量"
+                       suffix="单位" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -243,17 +248,21 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="价格">
-              <a-input class="dialogInput suffixGrey" placeholder="请输入价格" suffix="元/单位" style="width: 200px"/>
+              <a-input class="dialogInput suffixGrey"
+                       placeholder="请输入价格"
+                       suffix="元/单位"
+                       style="width: 200px" />
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="金额" class="relative">
-                <span class="white">输入数量和价格后自动算</span>
-                <span class="unit">元</span>
+            <a-form-item label="金额"
+                         class="relative">
+              <span class="white">输入数量和价格后自动算</span>
+              <span class="unit">元</span>
             </a-form-item>
           </a-col>
-      </a-row>
-      <a-row :gutter="24">
+        </a-row>
+        <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="交收期">
               <a-select class="inlineFormSelect"
@@ -280,7 +289,9 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="保证金">
-              <a-input class="dialogInput suffixGrey" placeholder="请输入保证金" suffix="元" />
+              <a-input class="dialogInput suffixGrey"
+                       placeholder="请输入保证金"
+                       suffix="元" />
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -315,7 +326,7 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="期货账户">
-                <a-select class="inlineFormSelect"
+              <a-select class="inlineFormSelect"
                         style="width: 200px"
                         placeholder="请选择期货账户">
                 <a-select-option value="1">
@@ -327,13 +338,13 @@
               </a-select>
             </a-form-item>
           </a-col>
-      </a-row>
-      <a-row :gutter="24">
+        </a-row>
+        <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="备注">
               <a-input class="dialogInput"
-                      style="width: 620px"
-                      placeholder="请输入备注" />
+                       style="width: 620px"
+                       placeholder="请输入备注" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -353,7 +364,28 @@ export default defineComponent({
     setup() {
         const { visible, cancel } = closeModal('spot_contract_btn_add');
         const loading = ref<boolean>(false);
-        const maskClosableFlag = ref<boolean>(false);
+
+        // 表单
+        const formRef = ref();
+        // const { formState, addOne, deleteOne } = handleFromState();
+        // const rules = {
+        //     deliverygoodsname: [{ required: true, message: '请输入现货品种名称', trigger: 'blur' }],
+        //     // unitid: [{ required: true, message: '请选择单位', trigger: 'change' }],
+        //     unitid: [{ required: true, validator: validateUnit, trigger: 'change' }],
+        //     gldwrstandards: {
+        //         unitid: { required: true, validator: validateUnit, trigger: 'change' },
+        //         wrstandardname: { required: true, message: '请输入品类', trigger: 'blur' },
+        //         convertfactor: { required: true, message: '请输入标仓系数', trigger: 'blur' },
+        //     },
+        //     glddgfactoryItems: {
+        //         dgfactoryitemvalue: { required: true, message: '请输入品牌', trigger: 'blur' },
+        //     },
+        //     wrsconvertdetails: {
+        //         middlegoodsid: { required: true, validator: valideteWR, trigger: 'change' },
+        //         convertratio: { required: true, message: '请输入套保系数', trigger: 'blur' },
+        //     },
+        // };
+
         function submit() {
             loading.value = true;
             setTimeout(() => {
@@ -367,7 +399,7 @@ export default defineComponent({
             cancel,
             submit,
             loading,
-            maskClosableFlag,
+            maskClosableFlag: false,
         };
     },
 });

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

@@ -0,0 +1,3 @@
+export function handleFromState() {
+
+}