Explorar el Código

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

marymelisa hace 4 años
padre
commit
a516a2077a

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

@@ -9,7 +9,7 @@ import { setServiceURL } from '@/services/request/serviceURL';
 import ProtobufCtr from '@/services/socket/protobuf/index';
 import { localStorageUtil } from '@/utils/storage';
 import { message } from 'ant-design-vue';
-import { GetErmcpGoods } from '../go/ermcp/goodsInfo';
+import { GetErmcpGoods, QueryDeliveryGoodsDetail } from '../go/ermcp/goodsInfo';
 
 /**
  * 全局数据刷新
@@ -34,7 +34,7 @@ export async function globalDataRefresh(): Promise<string> {
             } else {
                 // token校验成功 马上轮询
                 checkTokenLoop();
-                await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), LoginQuery()])
+                await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), LoginQuery(), QueryDeliveryGoodsDetail()])
             }
         } else {
             // 重置数据中心数据

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

@@ -2,7 +2,7 @@ import APP from '@/services';
 import { isAllEnum } from '@/services/bus/allEnum';
 import { checkTokenLoop } from '@/services/bus/token';
 import { getAllEnums, GetPCMenus, getServerTime, queryErrorInfos, QueryTableDefine } from '@/services/go/commonService/index';
-import { GetErmcpGoods } from '@/services/go/ermcp/goodsInfo';
+import { GetErmcpGoods, QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
 import { GetLoginID, LoginQuery } from '@/services/go/useInfo/index';
 import { localStorageUtil } from '@/utils/storage';
 import { sessionStorageUtil } from '@/utils/storage/index';
@@ -25,7 +25,7 @@ export const login = async (logidCode: string, password: String, byteArr: Uint8A
 
         // localstorage 缓存登录信息,处理页面刷新
         setLoginData(loginData);
-        await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), getServerTime(), LoginQuery()])
+        await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), getServerTime(), LoginQuery(), QueryDeliveryGoodsDetail()])
         // await GetPCMenus();
         // await QueryTableDefine();
         // 获取服务时间

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

@@ -18,6 +18,7 @@ const needClearSourceData: NeedClearSourceDataType = {
     menus: [],
     tableHead: [],
     Goods: [],
+    DeliveryGoodsList: [],
 
     queryClientFixedADConfigs: [],
     checkTokenTimeDiff: Math.floor(Math.random() * 6 + 5) * 60 * 1000,

+ 2 - 1
src/services/dataCenter/interface.ts

@@ -1,5 +1,5 @@
 import { OperationTabMenu, TableDefineRsp } from '@/services/go/commonService/interface';
-import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
+import { ErmcpDeliveryGoodsDetailEx, Goods } from '@/services/go/ermcp/goodsInfo/interface';
 import * as useInfo from '@/services/go/useInfo/interface';
 import * as mineType from '@/services/http/mine/interface';
 import * as Type from '@/services/http/notice/interface';
@@ -36,6 +36,7 @@ export interface NeedClearSourceDataType {
     menus: OperationTabMenu[]; // 交易端菜单
     tableHead: TableDefineRsp[]; // 动态表头
     Goods: Goods[],
+    DeliveryGoodsList: ErmcpDeliveryGoodsDetailEx[], // 现货品种
 
     queryClientFixedADConfigs: advert.fixedADConfigs[]; //首页图片广告
     checkTokenTimeDiff: number; // 轮休校验token时间差

+ 1 - 1
src/services/go/ermcp/finance-review/interface.ts

@@ -77,7 +77,7 @@ export interface QryBussinessFpRsp {
     enumdicname: string;//单位名称
     goodscode: string;//点价合约
     goodsname: string;//商品名称
-    invoiceamount: number;//已开收票金额(销售为开票,采购为收票)
+    InvoiceAmount: number;//已开收票金额(销售为开票,采购为收票)
     operateapplyid: string;//操作申请ID(6number;
     //3+Unix秒时间戳(1number;
     //位)+xxxxxx)

+ 5 - 3
src/services/go/ermcp/goodsInfo/index.ts

@@ -55,9 +55,11 @@ export function QueryGoodsbrand(): Promise<Ermcp3Brand[]> {
  * @param deliverygoodsid 现货商品id
  * @constructor
  */
-export function QueryDeliveryGoodsDetail(deliverygoodsid?: number): Promise<ErmcpDeliveryGoodsDetailEx[]> {
-    const req = deliverygoodsid ? { deliverygoodsid, userid: getUserId() } : { userid: getUserId() }
-    return commonSearch_go('/Ermcp3/QueryDeliveryGoodsDetail', req).catch((err) => {
+export function QueryDeliveryGoodsDetail(): Promise<ErmcpDeliveryGoodsDetailEx[]> {
+    return commonSearch_go('/Ermcp3/QueryDeliveryGoodsDetail', { userid: getUserId() }).then(res => {
+        APP.set('DeliveryGoodsList', res)
+        return res
+    }).catch((err) => {
         throw new Error(`查询现货商品详情: ${err.message}`);
     });
 }

+ 16 - 1
src/services/go/ermcp/warehouse-info/index.ts

@@ -1,7 +1,11 @@
 /** ================================= 仓库信息 ================================**/
 import { getUserId } from '@/services/bus/account';
 import { commonSearch_go } from '@/services/go';
-import { Ermcp3AreaStock, ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
+import {
+    Ermcp3AreaStock,
+    Ermcp3AreaStockApplySum,
+    ErmcpWareHouseInfo
+} from '@/services/go/ermcp/warehouse-info/interface';
 
 /**
  * 查询仓库信息 /Ermcp/QueryWarehouseInfo
@@ -25,3 +29,14 @@ export function QueryAreaStock(userid: number): Promise<Ermcp3AreaStock[]> {
         throw new Error(`查询机构库存(库存管理/当前库存): ${err.message}`);
     });
 }
+
+/**
+ * 查询已登记出入库信息(入库登记/已入库信息 | 出库登记/已出库信息) /Ermcp3/QueryAreaStockApplySum
+ * @param spotcontractid 合同ID
+ * @constructor
+ */
+export function QueryAreaStockApply(spotcontractid: number): Promise<Ermcp3AreaStockApplySum> {
+    return commonSearch_go('/Ermcp3/QueryAreaStockApplySum', { spotcontractid }).catch((err) => {
+        throw new Error(`查询已登记出入库信息(入库登记/已入库信息): ${err.message}`);
+    });
+}

+ 11 - 0
src/services/go/ermcp/warehouse-info/interface.ts

@@ -58,3 +58,14 @@ export interface Ermcp3AreaStock{
     wrstandardname	:string;//品类名称
 }
 
+export interface Ermcp3AreaStockApplySum{
+    brandname       :string;//品牌名称
+    inouttype       :number;//出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+    spotcontractid  :string;//关联现货合同ID
+    spotgoodsbrandid        :number;//品牌id
+    totalqty        :number;//总数量
+    wrstandardid    :number;//品类id
+    wrstandardname  :string;//品类名称
+}
+
+

+ 17 - 21
src/views/business/plan/components/add/index.vue

@@ -66,6 +66,7 @@
                        name="WRStandardID">
             <a-select class="inlineFormSelect"
                       style="width: 200px"
+                      @change="chooseWR"
                       v-model:value="formState.WRStandardID"
                       placeholder="请选择品类">
               <a-select-option v-for="item in gmlist"
@@ -144,21 +145,16 @@
 <script lang="ts">
 import { defineComponent, ref, toRaw } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import {formatTime, initData} from '@/common/methods/index';
+import { formatTime, initData } from '@/common/methods/index';
 import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
 import { AllEnums } from '@/services/go/commonService/interface';
-import { getAllEnum } from '@/services/bus/allEnum';
-import {changeStatus, getMiddleGoodsD, handleForm, handleTrader} from '../setup';
+import { changeStatus, getMiddleGoodsD, handleForm, handleTrader } from '../setup';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { FormState } from '@/views/information/spot-contract/components/interface';
-import { context } from 'ant-design-vue/lib/vc-image/src/PreviewGroup';
-import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
-import {hedgePlanReq} from "@/services/proto/hedgeplan";
-import {getLongTypeLoginID} from "@/services/bus/login";
-import {LongType} from "@/services/socket/login/interface";
-import moment from "moment";
-import APP from "@/services";
-import * as Long from "long";
+import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
+import { getLongTypeLoginID } from '@/services/bus/login';
+import { LongType } from '@/services/socket/login/interface';
+import APP from '@/services';
 
 export default defineComponent({
     name: 'add-custom',
@@ -166,16 +162,15 @@ export default defineComponent({
     setup(props, context) {
         const { visible, cancel } = closeModal('plan_btn_add');
         const planTye = ref<AllEnums[]>(getSpotContractTypeEnumList());
-        // const arr = getAllEnum().filter((e) => e.enumdicname === '销售');
-        // console.log('arr', arr);
+        // 表单
+        const { formRef, formState, rules } = handleForm();
         // 品种、品类
-        const { DGList, getDG, gmlist, chooseMG } = getMiddleGoodsD();
+        const { DGList, getDG, gmlist, chooseMG, chooseWR } = getMiddleGoodsD(formState);
         // 交易用户
         const { traderList, getRoleList } = handleTrader();
         // 币种
         const priceTyep = getPayCurrencyTypeEnumList();
-        // 表单
-        const { formRef, formState, rules } = handleForm();
+
         const loading = ref<boolean>(false);
         function submit(OperateType: 1 | 2) {
             formRef.value
@@ -189,19 +184,19 @@ export default defineComponent({
                         ContractType: param.ContractType, // 计划类型
                         DeliveryGoodsID: Number(param.DeliveryGoodsID),
                         WRStandardID: Number(param.WRStandardID), // 现货品种
-                        PlanQty: Number(param.PlanQty),  // 计划数量
+                        PlanQty: Number(param.PlanQty), // 计划数量
                         OperateType: OperateType,
                         Currencyid: param.Currencyid,
+                        ConvertFactor: param.ConvertFactor,
                         ApplyId: Number(loginId),
-                        PlanTime: formatTime(moment(), "s"),
+                        PlanTime: formatTime(new Date(), 's'),
                         ProductType: 1,
                         Biztype: 1,
                         AreaUserID: userid,
                         Remark: param.Remark,
                         Tradeuserid: param.Tradeuserid, // 交易用户id
-                    }
-                    changeStatus(reqParam, OperateType, loading)
-                    .then(() => {
+                    };
+                    changeStatus(reqParam, OperateType, loading).then(() => {
                         cancel();
                         context.emit('refresh', true);
                     });
@@ -229,6 +224,7 @@ export default defineComponent({
             formRef,
             formState,
             rules,
+            chooseWR,
         };
     },
 });

+ 3 - 0
src/views/business/plan/components/audit/index.vue

@@ -122,6 +122,9 @@ export default defineComponent({
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         OperateType: 4,
                         Remark: '通过',
+                        Currencyid: props.selectedRow.currencyid,  // 结算币种id
+                        Tradeuserid: props.selectedRow.tradeuserid, // 交易用户id
+
                     };
                     changeStatus(params, 4, loading)
                         .then((res) => {

+ 1 - 1
src/views/business/plan/components/interface.ts

@@ -7,7 +7,7 @@ export interface FormState {
     // ProductType?: number // int32 产品类型-1:标准仓单2:等标3:非标
     // SpotGoodsDesc?: string // string 商品型号
     PlanQty: string, // double 计划数量
-    ConvertFactor: number // double 标仓系数
+    ConvertFactor: number | undefined // double 标仓系数
     // PlanTime?: string // string 计划时间
     // TradeDate?: string // string 交易日(yyyyMMdd)
     // ApplySrc?: number // int32 申请来源 - 1:管理端 2:终端

+ 158 - 133
src/views/business/plan/components/modify/index.vue

@@ -11,173 +11,126 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">完成</a-button>
+                @click="submit(2)">完成</a-button>
     </template>
     <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
+            ref="formRef"
+            :model="formState"
+            :rules="rules">
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="客户类型">
-            <a-select class="typeSelect"
+          <a-form-item label="计划类型"
+                       name="ContractType">
+            <a-select class="inlineFormSelect"
                       style="width: 200px"
-                      placeholder="请选择客户类型">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
+                      v-model:value="formState.ContractType"
+                      placeholder="请选择计划类型">
+              <a-select-option v-for="item in planTye"
+                               :value="item.enumitemname"
+                               :key="item.autoid">
+                {{item.enumdicname}}
               </a-select-option>
             </a-select>
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item label="企业名称">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入企业名称" />
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="企业简称">
+          <a-form-item label="计划名称"
+                       name="HedgePlanNo">
             <a-input class="dialogInput"
+                     v-model:value="formState.HedgePlanNo"
                      style="width: 200px"
-                     placeholder="请输入企业简称" />
+                     placeholder="请输入计划名称" />
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item label="证件类型">
+          <a-form-item label="现货品种"
+                       name="DeliveryGoodsID">
             <a-select class="inlineFormSelect"
                       style="width: 200px"
-                      placeholder="请选择证件类型">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
+                      v-model:value="formState.DeliveryGoodsID"
+                      @change="chooseMG"
+                      placeholder="请选择现货品种">
+              <a-select-option v-for="item in DGList"
+                               :value="item.data.deliverygoodsid"
+                               :key="item.data.deliverygoodsid">
+                {{item.data.deliverygoodsname}}
               </a-select-option>
             </a-select>
           </a-form-item>
         </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="法定代表人">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入法定代表人" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="证件号码">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入证件号码" />
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="纳税人识别号">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入纳税人识别号" />
-          </a-form-item>
-        </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>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="联系人">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入联系人" />
+          <a-form-item label="品类"
+                       name="WRStandardID">
+            <a-select class="inlineFormSelect"
+                      style="width: 200px"
+                      @change="chooseWR"
+                      v-model:value="formState.WRStandardID"
+                      placeholder="请选择品类">
+              <a-select-option v-for="item in gmlist"
+                               :value="item.wrstandardid"
+                               :key="item.wrstandardid">
+                {{item.wrstandardname}}
+              </a-select-option>
+            </a-select>
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item label="联系人手机号">
-            <a-input class="dialogInput"
+          <a-form-item label="标仓系数"
+                       name="">
+            <a-input class="ConvertFactor"
+                     v-model:value="formState.ConvertFactor"
+                     readonly
                      style="width: 200px"
-                     placeholder="请输入联系人手机号" />
+                     placeholder="请输入标仓系数" />
           </a-form-item>
         </a-col>
-      </a-row>
-      <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="联系电话">
+          <a-form-item label="计划量"
+                       class="relative"
+                       name="PlanQty">
             <a-input class="dialogInput"
                      style="width: 200px"
-                     placeholder="请输入联系电话" />
+                     v-model:value="formState.PlanQty"
+                     placeholder="请输入计划量" />
           </a-form-item>
         </a-col>
         <a-col :span="12">
-          <a-form-item>
-            &nbsp;
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="通讯地址">
-            <a-select class="inlineFormSelect"
-                      style="width: 205px"
-                      placeholder="请选择省">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
-              </a-select-option>
-            </a-select>
+          <a-form-item label="交易用户"
+                       name="Tradeuserid">
             <a-select class="inlineFormSelect"
-                      style="width: 205px"
-                      placeholder="请选择市">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
+                      style="width: 200px"
+                      v-model:value="formState.Tradeuserid"
+                      placeholder="请选择交易用户">
+              <a-select-option v-for="item in traderList"
+                               :value="item.roleid"
+                               :key="item.roleid">
+                {{item.rolename}}
               </a-select-option>
             </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="结算币种"
+                       name="Currencyid">
             <a-select class="inlineFormSelect"
-                      style="width: 205px"
-                      placeholder="请选择县(区)">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
+                      style="width: 200px"
+                      v-model:value="formState.Currencyid"
+                      placeholder="请选择结算币种">
+              <a-select-option v-for="item in priceTyep"
+                               :key="item.enumdicid"
+                               :value="item.enumdicid">
+                {{item.enumdicname}}
               </a-select-option>
             </a-select>
           </a-form-item>
         </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="&nbsp;">
-            <a-input class="dialogInput"
-                     style="width: 635px"
-                     placeholder="请输入详细地址" />
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
         <a-col :span="24">
-          <a-form-item label="备注">
+          <a-form-item label="备注"
+                       class="relative"
+                       name="Remark">
             <a-input class="dialogInput"
-                     style="width: 635px"
+                     v-model:value="formState.Remark"
+                     style="width: 636px"
                      placeholder="请输入备注" />
           </a-form-item>
         </a-col>
@@ -187,32 +140,104 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import { defineComponent, PropType, ref, toRaw, watchEffect } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import { initData } from '@/common/methods/index';
+import { formatTime, initData } from '@/common/methods/index';
+import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
+import { AllEnums } from '@/services/go/commonService/interface';
+import { changeStatus, getMiddleGoodsD, handleForm, handleTrader } from '../setup';
+import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
+import { FormState } from '@/views/information/spot-contract/components/interface';
+import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
+import { getLongTypeLoginID } from '@/services/bus/login';
+import { LongType } from '@/services/socket/login/interface';
+import APP from '@/services';
+import { mergeTwoObj } from '@/utils/objHandle';
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 
 export default defineComponent({
     name: 'plan_uncommitted_modify',
     components: {},
     props: {
-        // selectedRow: {
-        //   type:
-        // }
+        selectedRow: {
+            type: Object as PropType<Ermcp3HedgePlan>,
+            default: {},
+        },
     },
-    setup() {
-        // const { visible, cancel } = closeModal('modifyCustomInfo');
+    setup(props, context) {
         const { visible, cancel } = closeModal('plan_uncommitted_modify');
+        const planTye = ref<AllEnums[]>(getSpotContractTypeEnumList());
+        // 表单
+        const { formRef, formState, rules } = handleForm();
+        // 品种、品类
+        const { DGList, getDG, gmlist, chooseMG, chooseWR } = getMiddleGoodsD(formState);
+        // 交易用户
+        const { traderList, getRoleList } = handleTrader();
+        // 币种
+        const priceTyep = getPayCurrencyTypeEnumList();
 
         const loading = ref<boolean>(false);
-        function submit() {
-            cancel();
+        watchEffect(() => {
+            if (props.selectedRow.contracttype) {
+                mergeTwoObj(formState, props.selectedRow);
+                const { deliverygoodsid, planqty } = props.selectedRow;
+                deliverygoodsid && chooseMG(deliverygoodsid);
+                formState.PlanQty = String(planqty);
+            }
+        });
+        function submit(OperateType: 1 | 2) {
+            formRef.value
+                .validate()
+                .then(() => {
+                    const param = toRaw(formState);
+                    const loginId = getLongTypeLoginID() as LongType;
+                    const userid = APP.get('userAccount').memberuserid;
+                    const reqParam: ErmcpHedgePlanReq = {
+                        HedgePlanNo: param.HedgePlanNo, // 计划类型
+                        ContractType: param.ContractType, // 计划类型
+                        DeliveryGoodsID: Number(param.DeliveryGoodsID),
+                        WRStandardID: Number(param.WRStandardID), // 现货品种
+                        PlanQty: Number(param.PlanQty), // 计划数量
+                        OperateType: OperateType,
+                        ConvertFactor: param.ConvertFactor,
+                        Currencyid: param.Currencyid,
+                        ApplyId: Number(loginId),
+                        PlanTime: formatTime(new Date(), 's'),
+                        ProductType: 1,
+                        Biztype: 1,
+                        AreaUserID: userid,
+                        Remark: param.Remark,
+                        Tradeuserid: param.Tradeuserid, // 交易用户id
+                    };
+                    changeStatus(reqParam, OperateType, loading).then(() => {
+                        cancel();
+                        context.emit('refresh', true);
+                    });
+                    console.log('param', param);
+                })
+                .catch((error: ValidateErrorEntity<FormState>) => {
+                    console.log('error', error);
+                });
         }
-        initData(() => {});
+        initData(() => {
+            getDG();
+            getRoleList();
+        });
         return {
             visible,
             cancel,
             submit,
             loading,
+            planTye,
+            DGList,
+            gmlist,
+            chooseMG,
+            traderList,
+            priceTyep,
+            formRef,
+            formState,
+            rules,
+            chooseWR,
         };
     },
 });

+ 20 - 7
src/views/business/plan/components/setup.ts

@@ -1,8 +1,8 @@
 import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
 import { validateCommon } from "@/common/setup/validate";
+import APP from '@/services';
 import { QueryAccMgrLoginUser } from "@/services/go/ermcp/account";
 import { ErmcpLoginUserEx } from "@/services/go/ermcp/account/interface";
-import { QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
 import { Ermcp3Wrstandard, ErmcpDeliveryGoodsDetailEx } from "@/services/go/ermcp/goodsInfo/interface";
 import { hedgePlanReq, oldHedgePlanReq } from "@/services/proto/hedgeplan";
 import { ErmcpHedgePlanReq, HedgePlanOperateReq } from "@/services/proto/hedgeplan/interface";
@@ -47,7 +47,7 @@ export function handleForm() {
         ContractType: undefined,// int32 计划类型-1:采购-1:销售
         DeliveryGoodsID: undefined,// uint64 现货品种ID
         PlanQty: '', // double 计划数量
-        ConvertFactor: 1, // double 标仓系数
+        ConvertFactor: undefined, // double 标仓系数
         Remark: '', // string 计划备注
         OperateType: 2, // int32 操作类型-1:保存草稿2:提交申请
         WRStandardID: undefined, // uint64 现货品类ID
@@ -76,23 +76,36 @@ export function handleForm() {
 /**
  * 获取现货品种和品类数据
  */
-export function getMiddleGoodsD() {
+export function getMiddleGoodsD(formState: UnwrapRef<FormState>) {
     // 现货品种列表
     const DGList = ref<ErmcpDeliveryGoodsDetailEx[]>([])
     // 品类
     const gmlist = ref<Ermcp3Wrstandard[]>([])
     // 获取品种数据
     function getDG() {
-        QueryDeliveryGoodsDetail().then(res => {
-            DGList.value = res.filter(e => e.data.isvalid === 1)
-        }).catch(err => message.error(err))
+        DGList.value = APP.get('DeliveryGoodsList').filter((e: ErmcpDeliveryGoodsDetailEx) => e.data.isvalid === 1)
     }
     // 选中品种数据
     function chooseMG(id: number) {
         const temp = DGList.value.find(e => e.data.deliverygoodsid === id)
         gmlist.value = temp ? temp.gmlist : []
+        formState.ConvertFactor = undefined
+        formState.WRStandardID = undefined
+    }
+    // 选中品类
+    function chooseWR(id: number | undefined) {
+        if (id) {
+            const temp = gmlist.value.find(e => e.wrstandardid === id)
+            if (temp) {
+                formState.ConvertFactor = temp.convertfactor
+            } else {
+                formState.ConvertFactor = undefined
+            }
+        } else {
+            formState.ConvertFactor = undefined
+        }
     }
-    return { DGList, getDG, gmlist, chooseMG }
+    return { DGList, getDG, gmlist, chooseMG, chooseWR }
 }
 
 /**

+ 1 - 2
src/views/information/goods/components/modify/index.vue

@@ -346,7 +346,6 @@ export default defineComponent({
             },
         };
         function submit() {
-            console.log('param', toRaw(formState));
             formRef.value
                 .validate()
                 .then(() => {
@@ -355,7 +354,6 @@ export default defineComponent({
                         cancel();
                         context.emit('refresh', true);
                     });
-                    console.log('param', param);
                 })
                 .catch((error: ValidateErrorEntity<FormState>) => {
                     console.log('error', error);
@@ -376,6 +374,7 @@ export default defineComponent({
             if (props.selctedDeliveryGoods.data.deliverygoodsname) {
                 const { data, gblist, gmlist, mgList } = props.selctedDeliveryGoods;
                 mergeTwoObj(formState, props.selctedDeliveryGoods);
+                mergeTwoObj(formState, data);
                 // 单位
                 formState.unitid = data.agreeunit;
                 // 品类

+ 25 - 30
src/views/information/goods/list/spot-variety/setup.ts

@@ -1,7 +1,6 @@
-import { QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
+import APP from '@/services';
 import { ErmcpDeliveryGoodsDetailEx, MenuList } from '@/services/go/ermcp/goodsInfo/interface';
 import { mergeObj } from '@/utils/objHandle';
-import { message } from 'ant-design-vue';
 import { reactive, Ref, ref } from 'vue';
 import { getInitMenuData } from '../../setup';
 
@@ -55,37 +54,33 @@ export function handleDG() {
     const selctedDeliveryGoods = reactive<ErmcpDeliveryGoodsDetailEx>(initDG())
     const isNormal = ref<boolean>(true) // true => 正常; false => 停用
     // 获取现货品种数据
-    function queryDG(param?: number) {
-        loading.value = true;
-        QueryDeliveryGoodsDetail(param).then(res => {
-            deliveryGoodsList.value = res;
-            res.forEach(e => {
-                const { dgstatus, isvalid, deliverygoodsname, deliverygoodsid } = e.data
-                if (isvalid) { // 有效 
-                    const normal = 'goods_info_spot_normal', disable = 'goods_info_spot_disable';
-                    const result = { key: deliverygoodsid.toString(), title: deliverygoodsname }
-                    if (dgstatus) { //1:正常
-                        if (menuMap.has(normal)) {
-                            const index = menuMap.get(normal) as number;
-                            menuList.value[index].children?.push(result)
-                        }
-                    } else {    // 0:未激活 
-                        if (menuMap.has(disable)) {
-                            const index = menuMap.get(disable) as number;
-                            menuList.value[index].children?.push(result)
-                        }
+    function queryDG() {
+        const res = APP.get('DeliveryGoodsList') as ErmcpDeliveryGoodsDetailEx[]
+        deliveryGoodsList.value = res;
+        res.forEach(e => {
+            const { dgstatus, isvalid, deliverygoodsname, deliverygoodsid } = e.data
+            if (isvalid) { // 有效 
+                const normal = 'goods_info_spot_normal', disable = 'goods_info_spot_disable';
+                const result = { key: deliverygoodsid.toString(), title: deliverygoodsname }
+                if (dgstatus) { //1:正常
+                    if (menuMap.has(normal)) {
+                        const index = menuMap.get(normal) as number;
+                        menuList.value[index].children?.push(result)
+                    }
+                } else {    // 0:未激活 
+                    if (menuMap.has(disable)) {
+                        const index = menuMap.get(disable) as number;
+                        menuList.value[index].children?.push(result)
                     }
                 }
-            })
-            // 获取默认第一条数据
-            if (menuList.value[0].children?.length) {
-                chooseDG({ key: menuList.value[0].children[0].key, is: true })
-            } else if (menuList.value[1].children?.length) {
-                chooseDG({ key: menuList.value[1].children[0].key, is: false })
             }
-        }).catch(err => {
-            message.error(err)
-        }).finally(() => loading.value = false)
+        })
+        // 获取默认第一条数据
+        if (menuList.value[0].children?.length) {
+            chooseDG({ key: menuList.value[0].children[0].key, is: true })
+        } else if (menuList.value[1].children?.length) {
+            chooseDG({ key: menuList.value[1].children[0].key, is: false })
+        }
     }
     interface Value {
         key: string;

+ 8 - 12
src/views/information/spot-contract/components/setup.ts

@@ -2,12 +2,13 @@ import { getPayCurrencyTypeEnumList } from "@/common/constants/enumsList";
 import { getGoodsUnitEnumItemName } from "@/common/constants/enumsName";
 import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
 import { validateCommon } from "@/common/setup/validate";
+import APP from '@/services';
 import { QueryAccMgrLoginUser } from "@/services/go/ermcp/account";
 import { ErmcpLoginUser } from "@/services/go/ermcp/account/interface";
 import { QueryCustomInfo } from "@/services/go/ermcp/customInfo";
 import { QueryCustomInfoType } from "@/services/go/ermcp/customInfo/interface";
-import { QueryDeliveryGoods, QueryDeliveryGoodsDetail } from "@/services/go/ermcp/goodsInfo";
-import { Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsRsp } from "@/services/go/ermcp/goodsInfo/interface";
+import { QueryDeliveryGoods } from "@/services/go/ermcp/goodsInfo";
+import { Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsDetailEx, ErmcpDeliveryGoodsRsp } from "@/services/go/ermcp/goodsInfo/interface";
 import { orderContract, spotContractStatus } from "@/services/proto/spotcontract";
 import {
     GldErmcpSpotContractOperateReq,
@@ -23,7 +24,6 @@ import { Value } from "./check/interface";
 import { FormState } from './interface';
 
 
-
 /**
  * 合同操作相关 针对操作类型 1: 保存草稿  2: 提交申请 3: 删除成功 4:审核通过
  * @param reqs GldErmcpSpotContractOperateReq
@@ -319,15 +319,11 @@ export function handleDeliveryGoods(formState: UnwrapRef<FormState>) {
 
     // 查询现货商品详情
     function getDeliveryGoodsDetail(deliverygoodsid: number) {
-        QueryDeliveryGoodsDetail(deliverygoodsid).then(res => {
-            if (res.length) {
-                gblist.value = res[0].gblist
-                gmlist.value = res[0].gmlist
-            }
-            console.log('查询品类', res);
-        }).catch(err => {
-            message.error(err)
-        })
+        const temp = APP.get('DeliveryGoodsList').find((e: ErmcpDeliveryGoodsDetailEx) => e.data.deliverygoodsid === deliverygoodsid)
+        if (temp) {
+            gblist.value = temp.gblist
+            gmlist.value = temp.gmlist
+        }
     }
 
     const numberUnit = ref<string>('')

+ 19 - 0
src/views/information/spot-contract/setup.ts

@@ -87,6 +87,25 @@ export function getContractTypeName(type: number): string{
     return result
 }
 
+/**
+ * 获取对手方名称
+ * @param type 采购 / 销售
+ * @param buyName 买方
+ * @param sellName 卖方
+ */
+export function getAnalogueName(type: number, buyName: string, sellName: string){
+    let result = "--";
+    switch (type){
+        case 1:
+            result = sellName
+            break;
+        case -1:
+            result = buyName
+            break;
+    }
+    return result
+}
+
 
 /************** 接口相关提示 **************** /
  *

+ 7 - 1
src/views/manage/business-review/list/someprice/index.vue

@@ -33,6 +33,11 @@
                 <template #contractstatus="{ text }">
                     <a>{{ getContractStatusName(text) }}</a>
                 </template>
+
+                <template #buyusernameOrsellusername="{ record }">
+                    <a>{{ getAnalogueName(record.contracttype, record.buyusername, record.sellusername) }}</a>
+                </template>
+
             </a-table>
         </contextMenu>
         <!-- 点价记录详情 -->
@@ -62,7 +67,7 @@ import {Filter, SomepriceDetail, SomepriceAudit, SomepriceCancel} from '../../co
 import {queryTableList, getFilterTableCB, QryBusinessDjRsp} from './setup';
 import {getPriceTypeName} from "@/views/business/purchase/setup";
 import {getApplyStatusName} from "@/views/manage/business-review/setup";
-import {getContractStatusName, getContractTypeName} from "@/views/information/spot-contract/setup";
+import {getAnalogueName, getContractStatusName, getContractTypeName} from "@/views/information/spot-contract/setup";
 
 export default defineComponent({
     name: 'business-review-dj',
@@ -112,6 +117,7 @@ export default defineComponent({
             getApplyStatusName,
             getContractTypeName,
             getContractStatusName,
+            getAnalogueName,
         };
     },
 });

+ 1 - 1
src/views/manage/finance-review/components/fundsDetail/index.vue

@@ -51,7 +51,7 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="登记金额">
-              <span class="white">{{ formatValue(selectedRow.deductamount) }}</span>
+              <span class="white">{{ formatValue(selectedRow.payamount) }}</span>
             </a-form-item>
           </a-col>
         </a-row>

+ 4 - 2
src/views/manage/finance-review/components/invoiceDetail/index.vue

@@ -56,14 +56,14 @@
                     </a-col>
                     <a-col :span="12">
                         <a-form-item label="发票金额">
-                            <span class="white">{{ formatValue(selectedRow.invoiceamount) }}</span>
+                            <span class="white">{{ formatValue(selectedRow.InvoiceAmount) }}</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.invoiceamount) }}</span>
+                            <span class="white">{{ formatValue(selectedRow.InvoiceAmount) }}</span>
                         </a-form-item>
                     </a-col>
                     <a-col :span="12">
@@ -110,6 +110,8 @@ export default defineComponent({
         const maskClosableFlag = ref<boolean>(false);
 
         function submit() {
+            console.log(props)
+            debugger
             context.emit('refresh');
             cancel()
         }