Browse Source

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

marymelisa 4 years ago
parent
commit
d8ff36642a

File diff suppressed because it is too large
+ 0 - 0
src/assets/styles/symbol_color/iconfont.js


File diff suppressed because it is too large
+ 0 - 0
src/assets/styles/symbol_no_color/iconfont.js


+ 1 - 1
src/router/index.ts

@@ -50,7 +50,7 @@ const routes: Array<RouteRecordRaw> = [
                     requireAuth: true,
                 },
                 redirect: (to) => {
-                    return { name: 'custom_info_normal' };
+                    return { name: 'custom_info_unsubmit' };
                 },
                 children: [
                     {

+ 13 - 1
src/services/go/ermcp/goodsInfo/index.ts

@@ -9,7 +9,7 @@ import {
     Ermcp3Wrstandard,
     ErmcpDeliveryGoodsDetailEx,
     ErmcpDeliveryGoodsReq,
-    ErmcpDeliveryGoodsRsp, ErmcpMiddleGoodsModel
+    ErmcpDeliveryGoodsRsp, ErmcpMiddleGoodsChangeLog, ErmcpMiddleGoodsModel
 } from './interface';
 
 /**
@@ -122,3 +122,15 @@ export function GetErmcpGoods(lastUpdateTime?: string): Promise<string> {
     });
 }
 
+/**
+ *  查询套保品种变更记录(菜单:套保品种/商品详情/变更记录) /Ermcp/QueryMiddleGoodsChangeLog
+ * @param middlegoodsid 套保品种id
+ * @constructor
+ */
+export function QueryMiddleGoodsChange(middlegoodsid: number): Promise<ErmcpMiddleGoodsChangeLog[]>{
+    const userid = getUserId(); // 用户id
+    return commonSearch_go('/Ermcp/QueryMiddleGoodsChangeLog', {userid, middlegoodsid}).catch((err) => {
+        throw new Error(`查询套保品种详情(套保品种/商品详情): ${err.message}`);
+    });
+}
+

+ 17 - 0
src/services/go/ermcp/goodsInfo/interface.ts

@@ -302,3 +302,20 @@ interface MenuItem {
 export interface MenuList extends MenuItem {
     children?: MenuItem[]
 }
+
+
+export interface ErmcpMiddleGoodsChangeLog{
+    aftervalue      :number;//变更后
+    applyid :number;//操作人
+    applyname       :string;//操作人名称
+    applysrc        :number;//操作来源 - 1:管理端 2:终端
+    beforevalue     :number;//变更前
+    changelogtype   :number;//变更流水类型 - 1:套保比率变更
+    handlestatus    :number;//处理状态
+    logdatetime     :string;//流水日期
+    logid   :number;//流水ID
+    logremark       :string;//流水备注
+    middlegoodsid   :number;//套保品种ID
+    tradedate       :string;//交易日(yyyyMMdd)
+    updatetime      :string;//更新时间
+}

+ 1 - 6
src/services/proto/delivery/index.ts

@@ -89,15 +89,10 @@ export const ermsMiddelGoodsEdit = (param: ErmsMiddelGoodsEditReq): Promise<any>
 export const deliveryGoodsCancel = (param: DeliveryGoodsCancelReq): Promise<any> => {
 
     return new Promise((resolve, reject) => {
-        const req = {
-            version: "3.2",
-            userid: getUserId(),
-            loginid: getLongTypeLoginID(),
-        };
         const params = {
             protobufName: 'DeliveryGoodsCancelReq',
             funCodeName: 'DeliveryGoodsCancelReq',
-            reqParams: Object.assign(req, param),
+            reqParams: param,
             msgHeadParams: {
                 AccountID: getSelectedAccountId() === null ? 0 : getSelectedAccountId(),
                 MarketID: 18,   // 目前写死

+ 1 - 1
src/utils/copy/index.ts

@@ -5,7 +5,7 @@ import { message } from 'ant-design-vue';
  * @param text
  */
 export function copyToClipboard(text: string): void {
-    if (text.indexOf('-') !== -1) {
+    if (text.includes('-')) {
         const arr = text.split('-');
         text = arr[0] + arr[1];
     }

+ 1 - 1
src/utils/objHandle/index.ts

@@ -47,7 +47,7 @@ export function mergeTwoObj(a: any, b: any, callBack?: Function) {
 export function objectToUint8Array(data: object) {
     const rawData: string = JSON.stringify(data);
     const outputArray = new Uint8Array(rawData.length);
-    for (var i = 0; i < rawData.length; ++i) {
+    for (let i = 0; i < rawData.length; ++i) {
         outputArray[i] = rawData.charCodeAt(i);
     }
     return outputArray;

+ 3 - 3
src/utils/websocket/index.ts

@@ -456,16 +456,16 @@ export class MTP2WebSocket<T extends Package40 | Package50> {
         }
 
         // 开始尝试重连服务端
-        if (this.onReconnectChangeState) this.onReconnectChangeState!(this, ReconnectChangeState.BeginReconnect);
+        if (this.onReconnectChangeState) this.onReconnectChangeState(this, ReconnectChangeState.BeginReconnect);
         this.conn(this.host)
             .then((res) => {
                 // 连接成功
                 this.isReconnecting = false;
-                if (this.onReconnectChangeState) this.onReconnectChangeState!(this, ReconnectChangeState.ReconnectSuccessed);
+                if (this.onReconnectChangeState) this.onReconnectChangeState(this, ReconnectChangeState.ReconnectSuccessed);
             })
             .catch((err) => {
                 // 连接失败
-                if (this.onReconnectChangeState) this.onReconnectChangeState!(this, ReconnectChangeState.FailAndWaitPeriod);
+                if (this.onReconnectChangeState) this.onReconnectChangeState(this, ReconnectChangeState.FailAndWaitPeriod);
 
                 // 5秒后尝试重连
                 if (this.reconnectTimer) {

+ 90 - 3
src/views/business/sell/components/detail/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 采购详情-->
-  <a-modal class="custom-detail"
+  <a-modal  class="commonModal paddingDialog purchase-detail"
            title="详情"
            v-model:visible="visible"
            @cancel="cancel"
@@ -12,17 +12,102 @@
                 :loading="loading"
                 @click="submit">关闭</a-button>
     </template>
-
+      <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.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同类型">
+                          <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</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.enumdicname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="现货品种">
+                          <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</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.qty + selectedRow.enumdicname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同暂定价">
+                          <span class="white">{{ formatValue(selectedRow.price) }}</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.goodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
+      <fieldset class="formFieldSet">
+          <legend>已登记信息</legend>
+          <a-form class="inlineForm">
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="已定价量">
+                          <span class="white">{{ selectedRow.pricedqty + selectedRow.enumdicname }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="已点均价">
+                          <span class="white">{{ formatValue(selectedRow.pricedavg) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
+      <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.pricemove) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {formatValue} from "@/common/methods";
+import {getPriceTypeName} from "@/views/business/purchase/setup";
+import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
 
 export default defineComponent({
     name: 'sell-detail',
     components: {},
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3SellBuyContract>,
+            default: {},
+        },
+    },
     setup() {
         const { visible, cancel } = closeModal('detail');
         const loading = ref<boolean>(false);
@@ -34,6 +119,8 @@ export default defineComponent({
             cancel,
             submit,
             loading,
+            formatValue,
+            getPriceTypeName,
         };
     },
 });

+ 164 - 5
src/views/business/sell/components/someprice/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <!-- 采购点价登记-->
-  <a-modal class="custom-detail"
+  <!-- 销售点价登记-->
+  <a-modal class="commonModal someprice"
            title="点价登记"
            v-model:visible="visible"
            @cancel="cancel"
@@ -12,28 +12,187 @@
                 :loading="loading"
                 @click="submit">关闭</a-button>
     </template>
+      <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.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="定价.
+                        类型">
+                          <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item :label="selectedRow.contracttype===1? '采购方': '销售方'">
+                          <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="现货品种">
+                          <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</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.qty + selectedRow.enumdicname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同暂定价">
+                          <span class="white">{{ formatValue(selectedRow.price) }}</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.goodsname) + selectedRow.currencyname }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
+      <fieldset class="formFieldSet">
+          <legend>已登记信息</legend>
+          <a-form class="inlineForm">
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="已定价量">
+                          <span class="white">{{ selectedRow.pricedqty + selectedRow.enumdicname }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="已点均价">
+                          <span class="white">{{ formatValue(selectedRow.pricedavg)  + selectedRow.currencyname }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
+      <fieldset class="formFieldSet">
+          <legend>本次点价信息</legend>
+          <a-form class="inlineForm"
+                  ref="formRef"
+                  :model="formState"
+                  :rules="rules">
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="点价价格"
+                                   name="PricedPrice">
+                          <a-input-number class="dialogInput"
+                                          style="width: 200px"
+                                          v-model:value="formState.PricedPrice"
+                                          :min="0"
+                                          placeholder="请输入点价价格" />
+                      </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">{{
+                      Number(selectedRow.pricemove) + Number(formState.PricedPrice)
+                  }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="点价数量"
+                                   class="relative"
+                                   name="PricedQty">
+                          <a-input-number class="dialogInput"
+                                          style="width: 200px"
+                                          v-model:value="formState.PricedQty"
+                                          :min="0"
+                                          :max="selectedRow.unpricedqty"
+                                          placeholder="请输入点价数量" />
+                          <div class="tip mt10">
+                              <span>未定价量<span class="white">{{ selectedRow.unpricedqty }}{{ selectedRow.enumdicname }}</span> </span>
+                              <a class="blue ml10"
+                                 @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</a>
+                          </div>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="点价金额">
+              <span class="white">{{
+                      (Number(selectedRow.pricemove) + Number(formState.PricedPrice)) * formState.PricedQty
+                  }}{{selectedRow.currencyname}}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref, unref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
+import {SomePriceReq} from "@/services/proto/contract/interface";
+import {somePriceReq} from "@/views/business/purchase/components/setup";
+import {handleForm} from "@/views/business/purchase/components/someprice/setup";
+import {formatValue} from "@/common/methods";
+import {getPriceTypeName} from "@/views/business/purchase/setup";
 
 export default defineComponent({
     name: 'sell_pending_someprice',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3SellBuyContract>,
+            default: {},
+        },
+    },
+    setup(props , context) {
         const { visible, cancel } = closeModal('sell_pending_someprice');
         const loading = ref<boolean>(false);
+        const { rules, formState, formRef } = handleForm();
         function submit() {
-            cancel();
+            const wrapEl = unref(formRef);
+            wrapEl.validate().then(() => {
+                loading.value = true;
+                const params: SomePriceReq = {
+                    PricedPrice: Number(formState.PricedPrice),
+                    PricedQty: Number(formState.PricedQty),
+                };
+                // 发出点价请求
+                somePriceReq(props.selectedRow.spotcontractid, params, loading)
+                    .then((res) => {
+                        cancel();
+                        context.emit('refresh');
+                    })
+                    .catch((err) => {});
+            });
         }
         return {
             visible,
             cancel,
             submit,
             loading,
+            formRef,
+            formState,
+            formatValue,
+            rules,
+            getPriceTypeName,
         };
     },
 });

+ 12 - 6
src/views/business/sell/list/all/index.vue

@@ -19,17 +19,23 @@
       </a-table>
     </contextMenu>
     <!-- 详情 -->
-    <Detail />
+    <Detail  :selectedRow="selectedRow"
+             @refresh="queryTable" />
     <!-- 采购点价登记 -->
-    <SomePrice />
+    <SomePrice  :selectedRow="selectedRow"
+                @refresh="queryTable" />
     <!-- 交收登记 -->
-    <Settlement />
+    <Settlement  :selectedRow="selectedRow"
+                 @refresh="queryTable" />
     <!-- 款项登记 -->
-    <Funds />
+    <Funds  :selectedRow="selectedRow"
+            @refresh="queryTable" />
     <!-- 发票登记 -->
-    <Invoice />
+    <Invoice  :selectedRow="selectedRow"
+              @refresh="queryTable" />
     <!-- 出库登记 -->
-    <Storage />
+    <Storage  :selectedRow="selectedRow"
+              @refresh="queryTable" />
   </div>
 </template>
 

+ 4 - 2
src/views/business/sell/list/pending/index.vue

@@ -20,9 +20,11 @@
       </a-table>
     </contextMenu>
     <!-- 详情 -->
-    <Detail />
+    <Detail  :selectedRow="selectedRow"
+             @refresh="queryTable" />
     <!-- 采购点价登记 -->
-    <SomePrice />
+    <SomePrice  :selectedRow="selectedRow"
+                @refresh="queryTable" />
   </div>
 </template>
 

+ 3 - 3
src/views/information/custom/compoments/add/interface.ts

@@ -15,9 +15,9 @@ export interface FormState {
     contactname: string; //联系人
     mobilephone: string; //手机号码 (加密存储)
     telphone: string; //联系电话(加密存储)
-    provinceid: number | null; //省
-    cityid: number | null; //市
-    districtid: number | null; //地区
+    provinceid: number | undefined; //省
+    cityid: number | undefined; //市
+    districtid: number | undefined; //地区
     remark: string; //备注
     cardaddress: string; //证件地址 (加密存储)
     username: string;//用户姓名

+ 3 - 3
src/views/information/custom/compoments/add/setup.ts

@@ -54,9 +54,9 @@ export function initFormState(): FormState {
         contactname: '',
         mobilephone: '',
         telphone: '',
-        provinceid: 0,
-        cityid: 0,
-        districtid: 0,
+        provinceid: undefined,
+        cityid: undefined,
+        districtid: undefined,
         cardaddress: '',
         remark: '',
         username: '',

+ 4 - 5
src/views/information/goods/components/add/setup.ts

@@ -5,6 +5,7 @@ import { DeliveryGoodsApplyReq } from '@/services/proto/delivery/interface';
 import { message } from 'ant-design-vue';
 import { reactive, ref, UnwrapRef } from 'vue';
 import { FormState } from './interface';
+import {addDeliveryGoods} from "@/views/information/goods/components/setup";
 
 /**
  * 处理新增
@@ -12,7 +13,7 @@ import { FormState } from './interface';
  */
 export function handleAdd() {
     const loading = ref<boolean>(false);
-    function addAction(param: FormState): Promise<void> {
+    function addAction(param: FormState): Promise<string> {
         const unitid = param.unitid === undefined ? 0 : param.unitid
         const reqParam: DeliveryGoodsApplyReq = {
             deliverygoodscode: param.deliverygoodscode,
@@ -44,10 +45,8 @@ export function handleAdd() {
             })
         }
         loading.value = true;
-        return addDeliveryGoodsApply(reqParam).then(() => {
-            message.success('新增现货品种成功!')
-            Promise.resolve()
-        }).catch(err => message.error(err.message)).finally(() => loading.value = false)
+        loading.value = true;
+        return addDeliveryGoods(reqParam, loading)
     }
     return { loading, addAction }
 }

+ 127 - 91
src/views/information/goods/components/disable/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 停用现货品种-->
-  <a-modal class="commonModal warehouse-disable"
+  <a-modal class="commonModal spot-detail"
            title="停用现货品种"
            v-model:visible="visible"
            centered
@@ -16,96 +16,130 @@
                 :loading="loading"
                 @click="submit">确认停用</a-button>
     </template>
-    <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="客户类型">
-            <span class="white">{{ selectedRow.userinfotype === '2' ? '企业' : '个人' }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="企业名称">
-            <span class="white">{{ formatValue(selectedRow.customername) }}</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.nickname) }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="证件类型">
-            <span class="white">{{ formatValue(selectedRow.cardtypename) }}</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.legalpersonname) }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="证件号码">
-            <span class="white">{{ formatValue(selectedRow.cardnum) }}</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.taxpayernum) }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="营业执照">
-            <a class="blue">查看附件</a>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="联系人">
-            <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="联系人手机号">
-            <span class="white">{{ formatValue(selectedRow.mobile) }}</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.telphone) }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="状态">
-            <span class="green">{{ formatValue(getStatusName(selectedRow.status)) }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="通讯地址">
-            <span class="white">{{ formatValue(selectedRow.address) }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="备注">
-            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
+      <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="现货品种名称"
+                                   name="deliverygoodsname">
+                          <span class="white">{{ formatValue(selectedRow.data.deliverygoodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="现货品种代码"
+                                   name="deliverygoodscode">
+                          <span class="white">{{ formatValue(selectedRow.data.deliverygoodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="单位"
+                                   name="unitid">
+                          <span class="white">{{ formatValue(selectedRow.data.enumdicname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="状态"
+                                   name="unitid">
+                          <span class="green">{{ getValidName(selectedRow.data.isvalid) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="24">
+                      <a-form-item label="备注"
+                                   name="remark">
+                          <span class="white">{{ formatValue(selectedRow.data.remark) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </fieldset>
+          <fieldset class="formFieldSet">
+              <legend>品类信息</legend>
+              <a-row :gutter="24"
+                     class="dialogRowTitle">
+                  <a-col :span="8">
+            <span>
+              品类
+            </span>
+                  </a-col>
+                  <a-col :span="8">
+            <span>
+              单位
+            </span>
+                  </a-col>
+                  <a-col :span="8">
+            <span>
+              标仓系数
+            </span>
+                  </a-col>
+                  <template v-for="item in selectedRow.gmlist" :key="item.wrstandardid">
+                      <a-col :span="8" class="bt1">
+                          <div class="white">{{ item.wrstandardname }}</div>
+                      </a-col>
+                      <a-col :span="8">
+                          <div class="white">{{ item.enumdicname }}</div>
+                      </a-col>
+                      <a-col :span="8">
+                          <div class="white">{{ item.convertfactor }}</div>
+                      </a-col>
+                  </template>
+              </a-row>
+          </fieldset>
+          <fieldset class="formFieldSet">
+              <legend>品牌信息</legend>
+              <a-row :gutter="24"
+                     class="dialogRowTitle dialogRowTitle2">
+                  <a-col :span="24">
+            <span>
+              品牌
+            </span>
+                  </a-col>
+                  <template v-for="item in selectedRow.gblist" :key="item.brandid">
+                      <a-col :span="24" class="bt1">
+                          <div class="white">{{ item.brandname }}</div>
+                      </a-col>
+                  </template>
+              </a-row>
+          </fieldset>
+          <fieldset class="formFieldSet">
+              <legend>套保品种信息</legend>
+              <a-row :gutter="24"
+                     class="dialogRowTitle">
+                  <a-col :span="8">
+            <span>
+              套保品种
+            </span>
+                  </a-col>
+                  <a-col :span="8">
+            <span>
+              单位
+            </span>
+                  </a-col>
+                  <a-col :span="8">
+            <span>
+              套保系数
+            </span>
+                  </a-col>
+                  <template v-for="item in selectedRow.mgList" :key="item.mg.middlegoodsid">
+                      <a-col :span="8" class="bt1">
+                          <div class="white">{{ item.mg.middlegoodsname }}</div>
+                      </a-col>
+                      <a-col :span="8">
+                          <div class="white">{{ item.mg.enumdicname }}</div>
+                      </a-col>
+                      <a-col :span="8">
+                          <div class="white">{{ item.mg.needhedgeratio }}</div>
+                      </a-col>
+                  </template>
+              </a-row>
+          </fieldset>
+      </a-form>
   </a-modal>
 </template>
 
@@ -119,6 +153,7 @@ import { getStatusName } from '@/views/information/custom/setup';
 import { Modal } from 'ant-design-vue';
 import { stopDeliveryGoods } from '@/views/information/goods/components/setup';
 import { ErmcpDeliveryGoodsDetailEx } from '@/services/go/ermcp/goodsInfo/interface';
+import {getValidName} from "@/views/information/goods/setup";
 
 export default defineComponent({
     name: 'custom-disable',
@@ -156,6 +191,7 @@ export default defineComponent({
             maskClosableFlag,
             formatValue,
             getStatusName,
+            getValidName,
         };
     },
 });

+ 26 - 21
src/views/information/goods/components/hedgingDetail/index.vue

@@ -16,8 +16,8 @@
                 @click="submit">完成</a-button>
     </template>
     <a-form class="inlineForm"
-    ref="formRef">
-    <fieldset class="formFieldSet">
+            ref="formRef">
+      <fieldset class="formFieldSet">
         <legend>基本信息</legend>
         <a-row :gutter="24">
           <a-col :span="12">
@@ -36,7 +36,7 @@
       </fieldset>
       <fieldset class="formFieldSet">
         <legend>修改套保比例列表</legend>
-         <a-row :gutter="24"
+        <a-row :gutter="24"
                class="dialogRowTitle">
           <a-col :span="5">
             <span>
@@ -58,13 +58,14 @@
               备注
             </span>
           </a-col>
-          <a-col :span="4" class="tc">
+          <a-col :span="4"
+                 class="tc">
             <span>
               修改人
             </span>
           </a-col>
-         </a-row>
-         <a-row :gutter="24"
+        </a-row>
+        <a-row :gutter="24"
                class="dialogRowTitle">
           <a-col :span="5">
             <span class="white">
@@ -86,13 +87,14 @@
               统一修改
             </span>
           </a-col>
-          <a-col :span="4" class="tc">
+          <a-col :span="4"
+                 class="tc">
             <span class="white">
               王平
             </span>
           </a-col>
-         </a-row>
-         <a-row :gutter="24"
+        </a-row>
+        <a-row :gutter="24"
                class="dialogRowTitle">
           <a-col :span="5">
             <span class="white">
@@ -114,13 +116,14 @@
               统一修改
             </span>
           </a-col>
-          <a-col :span="4" class="tc">
+          <a-col :span="4"
+                 class="tc">
             <span class="white">
               王平
             </span>
           </a-col>
-         </a-row>
-         <a-row :gutter="24"
+        </a-row>
+        <a-row :gutter="24"
                class="dialogRowTitle">
           <a-col :span="5">
             <span class="white">
@@ -142,35 +145,38 @@
               统一修改
             </span>
           </a-col>
-          <a-col :span="4" class="tc">
+          <a-col :span="4"
+                 class="tc">
             <span class="white">
               王平
             </span>
           </a-col>
-         </a-row>
+        </a-row>
       </fieldset>
     </a-form>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import { defineComponent, PropType, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods/index';
+import { initMG } from '../../list/hedging-variety/setup';
+import { Ermcp3MiddleGoodsDetail2 } from '@/services/go/ermcp/goodsInfo/interface';
 
 export default defineComponent({
-    name: 'modify-custom',
+    name: 'hedging-detail',
     components: {},
     props: {
-        // selectedRow: {
-        //   type:
-        // }
+        selctedMG: {
+            default: initMG,
+            type: Object as PropType<Ermcp3MiddleGoodsDetail2>,
+        },
     },
     setup() {
         const { visible, cancel } = closeModal('detail');
 
         const loading = ref<boolean>(false);
-        const maskClosableFlag = ref<boolean>(false);
         function submit() {
             cancel();
         }
@@ -188,7 +194,6 @@ export default defineComponent({
 
 <style lang="less">
 .hedgingDetail {
-    
 }
 </style
 >;

+ 5 - 10
src/views/information/goods/components/modify/setup.ts

@@ -5,21 +5,19 @@ import { DeliveryGoodsApplyReq } from '@/services/proto/delivery/interface';
 import { message } from 'ant-design-vue';
 import { reactive, ref, UnwrapRef } from 'vue';
 import { FormState } from './interface';
+import {addDeliveryGoods, modifyDeliveryGoods} from "@/views/information/goods/components/setup";
 
 /**
- * 处理新增
- * @returns 
+ * 处理修改
  */
 export function handleAdd() {
     const loading = ref<boolean>(false);
-    function addAction(param: FormState): Promise<void> {
+    function addAction(param: FormState): Promise<string> {
         const unitid = param.unitid === undefined ? 0 : param.unitid
         const reqParam: DeliveryGoodsApplyReq = {
-            deliverygoodscode: param.deliverygoodscode,
-            deliverygoodsname: param.deliverygoodsname,
             deliverygoodsid: param.deliverygoodsid,
             unitid: unitid,
-            type: 1,
+            type: 2,
             remark: param.remark,
             gldwrstandards: param.gldwrstandards.map(value => {
                 const gldunitid = value.unitid === undefined ? 0 : value.unitid
@@ -44,10 +42,7 @@ export function handleAdd() {
             })
         }
         loading.value = true;
-        return addDeliveryGoodsApply(reqParam).then(() => {
-            message.success('新增现货品种成功!')
-            Promise.resolve()
-        }).catch(err => message.error(err.message)).finally(() => loading.value = false)
+        return modifyDeliveryGoods(reqParam, loading)
     }
     return { loading, addAction }
 }

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

@@ -134,7 +134,7 @@
         </a-collapse-panel>
       </a-collapse>
     </div>
-    <HedgingDetail :selctedMG="selctedMG" />
+    <HedgingDetail :selectedRow="selctedMG" />
     <HedgingModify :selctedMG="selctedMG" />
 
   </div>
@@ -146,7 +146,7 @@ import { initMG } from '@/views/information/goods/list/hedging-variety/setup';
 import { Ermcp3MiddleGoodsDetail2 } from '@/services/go/ermcp/goodsInfo/interface';
 import { initData } from '@/common/methods';
 import HedgingModify from '../hedgingModify/index.vue';
-import HedgingDetail from '../spotDetail/index.vue';
+import HedgingDetail from '../hedgingDetail/index.vue';
 import { BtnList } from '@/common/export/table';
 import { getThirdMenuData, handleBtnList } from '@/common/setup/table/button';
 import { getGoodsUnitEnumItemName } from '@/common/constants/enumsName';

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

@@ -114,7 +114,7 @@
     </div>
     <Modify :selctedDeliveryGoods="selctedDeliveryGoods" />
     <Disable :selectedRow="selctedDeliveryGoods" />
-    <SpotDetail />
+    <SpotDetail  :selectedRow="selctedDeliveryGoods" />
   </div>
 </template>
 

+ 25 - 3
src/views/information/goods/components/setup.ts

@@ -1,8 +1,8 @@
-import {DeliveryGoodsSign} from "@/views/information/goods/setup";
+import {DeliveryGoodsSign, DeliveryTypeSign} from "@/views/information/goods/setup";
 import {commonResultInfo, getRequestResultInfo} from "@/common/methods/request";
 import {hedgePlanReq} from "@/services/proto/hedgeplan";
-import {deliveryGoodsCancel} from "@/services/proto/delivery";
-import {DeliveryGoodsCancelReq} from "@/services/proto/delivery/interface";
+import {addDeliveryGoodsApply, deliveryGoodsCancel} from "@/services/proto/delivery";
+import {DeliveryGoodsApplyReq, DeliveryGoodsCancelReq} from "@/services/proto/delivery/interface";
 import {Ref} from "vue";
 
 /**
@@ -27,6 +27,28 @@ export function resumeDeliveryGoods(wrstandardid: string, loading: Ref<boolean>)
     return commonResultInfo(result, sign, loading)
 }
 
+/**
+ * 现货品种新增
+ * @param reqParam
+ * @param loading
+ */
+export function addDeliveryGoods(reqParam: DeliveryGoodsApplyReq, loading: Ref<boolean>) :Promise<string>{
+    const sign = getRequestResultInfo(DeliveryTypeSign, 1)  // 接口请求后的返回提示 这里统一进行管理
+    const result = addDeliveryGoodsApply(reqParam)
+    return commonResultInfo(result, sign, loading)
+}
+
+/**
+ * 现货品种修改
+ * @param reqParam
+ * @param loading
+ */
+export function modifyDeliveryGoods(reqParam: DeliveryGoodsApplyReq, loading: Ref<boolean>) :Promise<string>{
+    const sign = getRequestResultInfo(DeliveryTypeSign, 2)  // 接口请求后的返回提示 这里统一进行管理
+    const result = addDeliveryGoodsApply(reqParam)
+    return commonResultInfo(result, sign, loading)
+}
+
 
 /**
  * 这里组装请求

+ 53 - 50
src/views/information/goods/components/spotDetail/index.vue

@@ -12,7 +12,8 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">完成</a-button>
+                @click="submit">完成
+      </a-button>
     </template>
     <a-form class="inlineForm"
             ref="formRef"
@@ -24,13 +25,13 @@
           <a-col :span="12">
             <a-form-item label="现货品种名称"
                          name="deliverygoodsname">
-              <span class="white">铜板</span>
+              <span class="white">{{ formatValue(selectedRow.data.deliverygoodsname) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="现货品种代码"
                          name="deliverygoodscode">
-              <span class="white">CU</span>
+              <span class="white">{{ formatValue(selectedRow.data.deliverygoodsname) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -38,13 +39,13 @@
           <a-col :span="12">
             <a-form-item label="单位"
                          name="unitid">
-              <span class="white"></span>
+              <span class="white">{{ formatValue(selectedRow.data.enumdicname) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="状态"
                          name="unitid">
-              <span class="green">正常</span>
+              <span class="green">{{ getValidName(selectedRow.data.isvalid) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -52,7 +53,7 @@
           <a-col :span="24">
             <a-form-item label="备注"
                          name="remark">
-              <span class="white">铜板的采购价按上海有色网AMMA00铜2021-2-8号均价计价</span>
+              <span class="white">{{ formatValue(selectedRow.data.remark) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -76,24 +77,19 @@
               标仓系数
             </span>
           </a-col>
-        <a-col :span="8" class="bt1">
-            <div class="white">TWX-1</div>
-        </a-col>
-        <a-col :span="8">
-            <div class="white">吨</div>
-        </a-col>
-        <a-col :span="8">
-            <div class="white">1.0</div>
-        </a-col>
-        <a-col :span="8">
-            <div class="white">TWX-2</div>
-        </a-col>
-        <a-col :span="8">
-            <div class="white">吨</div>
-        </a-col>
-        <a-col :span="8">
-            <div class="white">1.1</div>
-        </a-col>
+          <template v-for="item in selectedRow.gmlist"
+                    :key="item.wrstandardid">
+            <a-col :span="8"
+                   class="bt1">
+              <div class="white">{{ item.wrstandardname }}</div>
+            </a-col>
+            <a-col :span="8">
+              <div class="white">{{ item.enumdicname }}</div>
+            </a-col>
+            <a-col :span="8">
+              <div class="white">{{ item.convertfactor }}</div>
+            </a-col>
+          </template>
         </a-row>
       </fieldset>
       <fieldset class="formFieldSet">
@@ -105,12 +101,13 @@
               品牌
             </span>
           </a-col>
-        <a-col :span="24" class="bt1">
-            <div class="white">江铜</div>
-        </a-col>
-        <a-col :span="24" class="bt1">
-            <div class="white">云铜</div>
-        </a-col>
+          <template v-for="item in selectedRow.gblist"
+                    :key="item.brandid">
+            <a-col :span="24"
+                   class="bt1">
+              <div class="white">{{ item.brandname }}</div>
+            </a-col>
+          </template>
         </a-row>
       </fieldset>
       <fieldset class="formFieldSet">
@@ -132,24 +129,19 @@
               套保系数
             </span>
           </a-col>
-            <a-col :span="8"  class="bt1">
-                <div class="white">标准铜</div>
-            </a-col>
-            <a-col :span="8">
-                <div class="white">吨</div>
-            </a-col>
-            <a-col :span="8">
-                <div class="white">1.0</div>
+          <template v-for="item in selectedRow.mgList"
+                    :key="item.mg.middlegoodsid">
+            <a-col :span="8"
+                   class="bt1">
+              <div class="white">{{ item.mg.middlegoodsname }}</div>
             </a-col>
             <a-col :span="8">
-                <div class="white">标准银</div>
+              <div class="white">{{ item.mg.enumdicname }}</div>
             </a-col>
             <a-col :span="8">
-                <div class="white">吨</div>
-            </a-col>
-            <a-col :span="8">
-                <div class="white">1.1</div>
+              <div class="white">{{ item.mg.needhedgeratio }}</div>
             </a-col>
+          </template>
         </a-row>
       </fieldset>
     </a-form>
@@ -157,26 +149,30 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import { defineComponent, PropType, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import { initData } from '@/common/methods/index';
+import { formatValue, initData } from '@/common/methods/index';
+import { ErmcpDeliveryGoodsDetailEx } from '@/services/go/ermcp/goodsInfo/interface';
+import { getValidName } from '@/views/information/goods/setup';
 
 export default defineComponent({
-    name: 'modify-custom',
+    name: 'spot-detail',
     components: {},
     props: {
-        // selectedRow: {
-        //   type:
-        // }
+        selectedRow: {
+            type: Object as PropType<ErmcpDeliveryGoodsDetailEx>,
+            default: {},
+        },
     },
     setup() {
         const { visible, cancel } = closeModal('detail');
 
         const loading = ref<boolean>(false);
-        const maskClosableFlag = ref<boolean>(false);
+
         function submit() {
             cancel();
         }
+
         initData(() => {});
         return {
             visible,
@@ -184,6 +180,8 @@ export default defineComponent({
             submit,
             loading,
             maskClosableFlag: false,
+            formatValue,
+            getValidName,
         };
     },
 });
@@ -194,8 +192,10 @@ export default defineComponent({
     fieldset {
         padding-right: 170px;
     }
+
     .upload {
         display: inline-flex;
+
         .ant-btn.uploadBtn {
             width: 60px;
             height: 30px;
@@ -206,11 +206,13 @@ export default defineComponent({
             font-size: 14px;
             color: @m-white0;
             .rounded-corners(3px);
+
             &:hover {
                 background: rgba(@m-blue0, 0);
                 color: rgba(@m-white0, 0.8);
             }
         }
+
         .look {
             color: @m-blue0;
             font-size: 14px;
@@ -218,6 +220,7 @@ export default defineComponent({
             cursor: pointer;
         }
     }
+
     div.white {
         width: 100%;
         text-align: center;

+ 21 - 0
src/views/information/goods/setup.ts

@@ -26,6 +26,22 @@ export function getInitMenuData(code: 'goods_info_spot' | 'goods_info_hedge'): M
     return { menuList, menuMap }
 }
 
+/**
+ * 获取现货品种状态
+ * @param type :未激活 1:正常
+ */
+export function getValidName(type: number){
+    let result = "--";
+    switch (type) {
+        case 0:
+            result = "未激活";
+            break
+        case 1:
+            result = "正常";
+            break
+    }
+    return result
+}
 
 
 /************** 接口请求相关提示 ****************/
@@ -35,3 +51,8 @@ export const DeliveryGoodsSign = new Map<number, ResultInfo>([
     [0, ['停用现货品种成功', '停用现货品种失败:']],
     [1, ['恢复现货品种成功', '恢复现货品种失败:']],
 ])
+
+export const DeliveryTypeSign = new Map<number, ResultInfo>([
+    [1, ['新增现货品种成功', '新增现货品种失败:']],
+    [2, ['修改现货品种成功', '修改现货品种失败:']],
+])

Some files were not shown because too many files changed in this diff