li.shaoyi 4 년 전
부모
커밋
bf8d227012

+ 1 - 1
src/common/methods/request/resultInfo.ts

@@ -47,7 +47,7 @@ export async function controlLoading(fn: Function, loading: Ref<boolean>, param?
     console.log('请求接口参数: ', param);
     loading.value = true;
     try {
-        const result = await param ? fn(param) : fn()
+        const result = await (param ? fn(param) : fn())
         loading.value = false;
         return result;
     } catch (err) {

+ 3 - 3
src/services/proto/delivery/interface.ts

@@ -78,9 +78,9 @@ export interface ErmcpSpotGoodsPriceReq {
     CurrencyID: number; // uint64 报价货币ID
     SpotGoodsPrice: number; // double 现货价格
     TradeDate: string; // string 交易日(yyyyMMdd)
-    OperateSrc: number // int32 最后操作来源 - 1:管理端 2:终端
-    OperateID: number; // uint64 最后操作人
-    OperateType: number; // int32 操作类型 - 1:新增 2:修改 3:删除
+    OperateSrc?: number // int32 最后操作来源 - 1:管理端 2:终端
+    OperateID?: number; // uint64 最后操作人
+    OperateType?: number; // int32 操作类型 - 1:新增 2:修改 3:删除
 }
 // 现货市价响应 0 29 163
 export interface ErmcpSpotGoodsPriceRsp {

+ 0 - 0
src/views/business/search/plan/index.vue → src/views/business/search/list/plan/index.vue


+ 107 - 4
src/views/business/spotmarket/components/detail/index.vue

@@ -1,8 +1,111 @@
 <template>
-  <div></div>
+    <!-- 现货参考价-详情 -->
+    <a-modal class="commonModal paddingDialog purchase-detail" title="现货参考价详情" v-model:visible="visible" centered @cancel="cancel" width="890px">
+        <fieldset class="formFieldSet">
+            <legend>现货信息</legend>
+            <a-form class="inlineForm">
+                <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-row>
+            </a-form>
+        </fieldset>
+        <fieldset class="formFieldSet">
+            <legend>修改记录</legend>
+            <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false"></a-table>
+        </fieldset>
+        <template #footer>
+            <a-button key="submit" type="primary" @click="cancel">关闭 </a-button>
+        </template>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent } from '@/common/export/commonTable';
-export default defineComponent({});
-</script>
+import { defineComponent, PropType, ref } from 'vue';
+import { formatValue } from '@/common/methods';
+import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
+import { getPriceTypeName } from '@/common/constants/enumsName';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { querySpotGoodsPriceLog } from '@/services/go/ermcp/qhj';
+import { Ermcp3SpotGoodsPriceLog, QuerySpotGoodsPriceLogReq } from '@/services/go/ermcp/qhj/interface';
+import { ColumnType } from '@/common/methods/table';
+import { getUserId } from '@/services/bus/user';
+
+export default defineComponent({
+    name: 'spotmarket_price_detail',
+    components: {},
+    emits: ['cancel', 'update'],
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3SellBuyContract>,
+            default: {},
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const tableList = ref<Ermcp3SpotGoodsPriceLog[]>([]);
+
+        // 表头对应字段
+        const columns: ColumnType[] = [
+            {
+                title: '变更时间',
+                dataIndex: 'operatetime',
+                key: 'operatetime',
+                align: 'center',
+                width: 120,
+            },
+            {
+                title: '价格',
+                dataIndex: 'spotgoodsprice',
+                key: 'spotgoodsprice',
+                align: 'center',
+                width: 120,
+            },
+            {
+                title: '操作人',
+                dataIndex: 'operatorname',
+                key: 'operatorname',
+                align: 'center',
+                width: 120,
+            },
+        ];
+
+        const param: QuerySpotGoodsPriceLogReq = {
+            userid: getUserId(),
+            deliverygoodsid: props.selectedRow.deliverygoodsid,
+        };
+
+        // 修改记录
+        querySpotGoodsPriceLog(param).then((res) => {
+            tableList.value = res;
+        });
+
+        return {
+            visible,
+            cancel,
+            columns,
+            tableList,
+            formatValue,
+            getPriceTypeName,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 35 - 13
src/views/business/spotmarket/components/modify/index.vue

@@ -1,7 +1,7 @@
 <template>
     <!-- 现货参考价-修改-->
     <a-modal class="add-custom custom-detail" title="修改现货参考价" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
-        <a-form class="inlineForm" :form="form" @submit="handleSearch">
+        <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
             <fieldset class="formFieldSet">
                 <legend>现货市价信息</legend>
                 <a-row :gutter="24">
@@ -23,8 +23,8 @@
                         </a-form-item>
                     </a-col>
                     <a-col :span="12">
-                        <a-form-item label="结算币种" name="currencyid">
-                            <a-select class="inlineFormSelect" style="width: 200px" placeholder="请选择结算币种" v-model:value="formState.currencyid">
+                        <a-form-item label="结算币种" name="CurrencyID">
+                            <a-select class="inlineFormSelect" style="width: 200px" placeholder="请选择结算币种" v-model:value="formState.CurrencyID">
                                 <a-select-option v-for="option in currencyList" :key="option.enumitemname" :value="option.enumitemname">{{ option.enumdicname }}</a-select-option>
                             </a-select>
                         </a-form-item>
@@ -32,8 +32,8 @@
                 </a-row>
                 <a-row :gutter="24">
                     <a-col :span="24">
-                        <a-form-item label="现货价格" name="spotgoodsprice">
-                            <a-input-number class="dialogInput" style="width: 200px" v-model:value="formState.spotgoodsprice" :min="0" placeholder="请输入现货价格" />
+                        <a-form-item label="现货价格" name="SpotGoodsPrice">
+                            <a-input-number class="dialogInput" style="width: 200px" v-model:value="formState.SpotGoodsPrice" :min="0" placeholder="请输入现货价格" />
                         </a-form-item>
                     </a-col>
                 </a-row>
@@ -47,12 +47,15 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
+import { defineComponent, PropType, ref, reactive, UnwrapRef } from 'vue';
 import { formatValue } from '@/common/methods';
-import { Modal } from 'ant-design-vue';
 import { Ermcp3SpotGoodsPrice } from '@/services/go/ermcp/qhj/interface';
+import { ErmcpSpotGoodsPriceReq } from '@/services/proto/delivery/interface';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { getPayCurrencyTypeEnumList } from '@/common/constants/enumsList';
+import { validateAction } from '@/common/setup/form';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { ermcpSpotGoodsPrice } from '@/services/proto/delivery';
 
 export default defineComponent({
     name: 'spotmarket_price_modify',
@@ -66,26 +69,45 @@ export default defineComponent({
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
+        const formRef = ref();
 
-        const formState = ref<{ [key: string]: number | null }>({
-            currencyid: props.selectedRow.currencyid,
-            spotgoodsprice: props.selectedRow.spotgoodsprice,
+        // 选择币种列表
+        const currencyList = getPayCurrencyTypeEnumList();
+
+        const { deliverygoodsid, wrstandardid, spotgoodsbrandid, tradedate, currencyid, spotgoodsprice } = props.selectedRow;
+        const formState: UnwrapRef<ErmcpSpotGoodsPriceReq> = reactive({
+            DeliveryGoodsID: deliverygoodsid,
+            WRStandardID: wrstandardid,
+            SpotGoodsBrandID: spotgoodsbrandid,
+            CurrencyID: currencyid,
+            SpotGoodsPrice: spotgoodsprice,
+            TradeDate: tradedate,
         });
 
-        const currencyList = getPayCurrencyTypeEnumList();
+        // 表单验证规则
+        const rules = {
+            CurrencyID: [{ required: true, message: '请选择结算币种', trigger: 'change', type: 'number' }],
+            SpotGoodsPrice: [{ required: true, message: '请输入现货价格', trigger: 'blur', type: 'number' }],
+        };
 
-        // 审核通过
+        // 提交
         function submit() {
-            // 提交
+            validateAction<ErmcpSpotGoodsPriceReq>(formRef, formState).then((res) => {
+                requestResultLoadingAndInfo(ermcpSpotGoodsPrice, res, loading, ['修改现货参考价成功', '修改现货参考价失败:']).then(() => {
+                    cancel(true);
+                });
+            });
         }
 
         return {
             visible,
+            formRef,
             cancel,
             submit,
             loading,
             formatValue,
             formState,
+            rules,
             currencyList,
         };
     },

+ 1 - 1
src/views/business/spotmarket/list/price/index.vue

@@ -40,7 +40,7 @@ export default defineComponent({
         const { loading, tableList, queryTable } = queryTableList<Ermcp3SpotGoodsPrice>();
 
         // 获取列表数据
-        const queryTableAction = () => queryTable(querySpotGoodsPrice, '2');
+        const queryTableAction = () => queryTable(querySpotGoodsPrice);
 
         // 表格通用逻辑
         const param: ComposeTableParam = {