瀏覽代碼

修改业务计划

huangbin 4 年之前
父節點
當前提交
fd12337915

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://218.17.158.45:21001/cfg?key=test_175"
+    "apiUrl": "http://192.168.31.175:8080/cfg?key=test_175"
 }

+ 4 - 1
src/common/constants/buttonType.ts

@@ -33,8 +33,11 @@ export interface ButtonType {
     sell_pending_storage: string; // 销售 出库登记
 
     plan_uncommitted_recommit: string; // 计划 重新提交
-    plan_uncommitted_modif: string; // 计划 修改
+    plan_uncommitted_modify: string; // 计划 修改
+    plan_uncommitted_delete: string; // 计划 删除
     plan_audit_audit: string; // 计划 审核
+    plan_audit_cancel: string; // 计划 撤销
+    plan_btn_add: string; // 计划 新增
 
     business_review_someprice_audit: string; // 点价 审核
     business_review_someprice_cancel: string; // 点价 撤销

+ 1 - 0
src/common/methods/table/interface.ts

@@ -43,4 +43,5 @@ export interface TableKey {
     table_pcweb_stock_manage_current: string; // 库存管理-当前库存
     table_pcweb_userinfo: string; // 客户资料
     table_pcweb_warehouse: string; // 仓库信息
+    table_pcweb_hedging_plan: string; // 计划
 }

+ 4 - 0
src/common/setup/table/interface.ts

@@ -35,6 +35,10 @@ export interface ButtonListKey {
     exposure_futures: string;   //期货头寸
     exposure_history: string;   //历史敞口
 
+    plan_uncommitted: string;   //计划 未提交
+    plan_audit: string;   //计划 待审核
+    plan_running: string;   //计划 执行中
+
     business_review_someprice: string; // 业务审核 点价
     business_review_settlement: string; // 业务审核 交收
 

+ 2 - 2
src/router/index.ts

@@ -314,7 +314,7 @@ const routes: Array<RouteRecordRaw> = [
                 redirect: { name: 'plan_uncommitted' },
                 children: [
                     {
-                        path: '/plan/pending',
+                        path: '/plan/uncommitted',
                         name: 'plan_uncommitted',
                         component: () => import('@/views/business/plan/list/uncommitted/index.vue'),
                         meta: {
@@ -323,7 +323,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/plan/audit',
-                        name: 'plan_audit_audit',
+                        name: 'plan_audit',
                         component: () => import('@/views/business/plan/list/audit/index.vue'),
                         meta: {
                             requireAuth: true,

+ 7 - 3
src/services/go/ermcp/plan/index.ts

@@ -1,3 +1,4 @@
+import { getUserId } from '@/services/bus/account';
 import { commonSearch_go } from '@/services/go';
 import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 
@@ -5,12 +6,15 @@ import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 
 /**
  * 查询套保计划 /Ermcp3/QueryHedgePlan
- * @param userId 用户ID
  * @param hedgeplanstatus 套保计划状态(允许多个,逗号隔开) - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
  * @constructor
  */
-export function QueryHedgePlan(userId: number, hedgeplanstatus: string): Promise<Ermcp3HedgePlan[]> {
-    return commonSearch_go('/Erms3/QueryHedgePlan', { userId, hedgeplanstatus }).catch((err) => {
+export function QueryHedgePlan(hedgeplanstatus: string): Promise<Ermcp3HedgePlan[]> {
+    const param = {
+        userid: getUserId(),
+        hedgeplanstatus
+    }
+    return commonSearch_go('/Ermcp3/QueryHedgePlan', param).catch((err) => {
         throw new Error(`查询套保计划: ${err.message}`);
     });
 }

+ 0 - 221
src/views/business/plan/compoments/add/index.vue

@@ -1,221 +0,0 @@
-<template>
-  <!-- 新增客户资料 -->
-  <a-modal class="add-custom"
-           title="新增客户资料"
-           v-model:visible="visible"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :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="客户类型">
-            <a-select class="typeSelect"
-                      style="width: 200px"
-                      placeholder="请选择客户类型">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
-              </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-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入企业简称" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="证件类型">
-            <a-select class="inlineFormSelect"
-                      style="width: 200px"
-                      placeholder="请选择证件类型">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
-              </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>
-        </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>
-            &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-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-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>
-        </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-input class="dialogInput"
-                     style="width: 635px"
-                     placeholder="请输入备注" />
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
-  </a-modal>
-</template>
-
-<script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import { initData } from '@/common/methods/index';
-
-export default defineComponent({
-    name: 'add-custom',
-    components: {},
-    setup() {
-        const { visible, cancel } = closeModal('custom_info_btn_add');
-        const loading = ref<boolean>(false);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
-        }
-        initData(() => {});
-        return {
-            visible,
-            cancel,
-            submit,
-            loading,
-        };
-    },
-});
-</script>
-
-<style lang="less">
-.add-custom {
-  
-}
-</style
->;

+ 51 - 0
src/views/business/plan/components/add/index.vue

@@ -0,0 +1,51 @@
+<template>
+  <!-- 新增计划 -->
+  <a-modal class="add-custom"
+           title="新增计划"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">完成</a-button>
+    </template>
+
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+import { initData } from '@/common/methods/index';
+
+export default defineComponent({
+    name: 'add-custom',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('plan_btn_add');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        initData(() => {});
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.add-custom {
+}
+</style
+>;

+ 4 - 4
src/views/business/plan/compoments/disable/index.vue → src/views/business/plan/components/audit/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <!-- 停用客户资料-->
+  <!-- 审核计划-->
   <a-modal class="commonModal warehouse-disable"
-           title="停用客户资料"
+           title="审核计划"
            v-model:visible="visible"
            @cancel="cancel"
            width="890px">
@@ -112,10 +112,10 @@ import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 
 export default defineComponent({
-    name: 'custom-disable',
+    name: 'plan_audit_audit',
     components: {},
     setup() {
-        const { visible, cancel } = closeModal('custom_info_btn_disable');
+        const { visible, cancel } = closeModal('plan_audit_audit');
         const loading = ref<boolean>(false);
         function submit() {
             loading.value = true;

+ 55 - 0
src/views/business/plan/components/cancel/index.vue

@@ -0,0 +1,55 @@
+<template>
+  <!-- 计划撤销-->
+  <a-modal class="custom-detail"
+           title="计划撤销"
+           v-model:visible="visible"
+           centered
+           :maskClosable="maskClosableFlag"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                class="cancelBtn"
+                @click="cancel">取消</a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">确认撤销</a-button>
+    </template>
+    plan_audit_cancel
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'plan_audit_cancel',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('plan_audit_cancel');
+        const loading = ref<boolean>(false);
+        const maskClosableFlag = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+            maskClosableFlag,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.plan_audit_cancel {
+}
+</style>;

+ 6 - 6
src/views/business/plan/compoments/delete/index.vue → src/views/business/plan/components/delete/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <!-- 恢复客户资料-->
-  <a-modal class="recover-custom"
-           title="恢复客户资料"
+  <!-- 删除计划-->
+  <a-modal class="plan_uncommitted_delete"
+           title="删除计划"
            v-model:visible="visible"
            @cancel="cancel"
            width="890px">
@@ -19,10 +19,10 @@ import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 
 export default defineComponent({
-    name: 'recover-custom',
+    name: 'plan_uncommitted_delete',
     components: {},
     setup() {
-        const { visible, cancel } = closeModal('custom_info_btn_delete');
+        const { visible, cancel } = closeModal('plan_uncommitted_delete');
         const loading = ref<boolean>(false);
         function submit() {
             loading.value = true;
@@ -42,7 +42,7 @@ export default defineComponent({
 </script>
 
 <style lang="less">
-.recover-custom {
+.plan_uncommitted_delete {
 }
 </style
 >;

+ 6 - 9
src/views/business/plan/compoments/detail/index.vue → src/views/business/plan/components/detail/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <!-- 客户资料详情-->
+  <!-- 计划详情-->
   <a-modal class="add-custom custom-detail"
-           title="客户资料详情"
+           title="计划详情"
            v-model:visible="visible"
            @cancel="cancel"
            width="890px">
@@ -59,7 +59,7 @@
         <a-col :span="12">
           <a-form-item label="营业执照">
             <div class="upload">
-                <div class="look">查看附件</div>
+              <div class="look">查看附件</div>
             </div>
           </a-form-item>
         </a-col>
@@ -111,10 +111,10 @@ import { defineComponent, PropType, reactive, ref, watchEffect } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { mergeObj } from '@/utils/objHandle';
-import {getStatusName} from "@/views/information/custom/setup";
+import { getStatusName } from '@/views/information/custom/setup';
 
 export default defineComponent({
-    name: 'custom-detail',
+    name: 'plan-detail',
     components: {},
     props: {
         selectedRow: {
@@ -137,7 +137,7 @@ export default defineComponent({
             telphone: props.selectedRow.telphone || '--',
             status: getStatusName(props.selectedRow.status) || '--',
             address: props.selectedRow.address || '--',
-            remark: props.selectedRow.remark || '--'
+            remark: props.selectedRow.remark || '--',
         });
         const loading = ref<boolean>(false);
         function submit() {
@@ -155,10 +155,7 @@ export default defineComponent({
             detail,
         };
     },
-
 });
-
-
 </script>
 
 <style lang="less">

+ 16 - 22
src/views/business/plan/compoments/filterTable/index.vue → src/views/business/plan/components/filterTable/index.vue

@@ -4,21 +4,18 @@
     <a-select label-in-value
               class="conditionSelect"
               style="width: 120px"
-              v-model:value="userinfotype"
-              placeholder="全部客户类型"
+              v-model:value="contracttype"
+              placeholder="全部计划类型"
               @change="handleChange">
-      <a-select-option value="1">个人</a-select-option>
-      <a-select-option value="2">企业</a-select-option>
+      <a-select-option value="1">采购</a-select-option>
+      <a-select-option value="-1">销售</a-select-option>
     </a-select>
-    <a-input v-model:value="nickname"
+    <a-input v-model:value="hedgeplanno"
              class="tableConditionInput"
-             placeholder="模糊搜索客户简称" />
-    <a-input v-model:value="name"
+             placeholder="模糊搜索计划" />
+    <a-input v-model:value="deliverygoodsname"
              class="tableConditionInput"
-             placeholder="模糊搜索客户名称" />
-    <a-input v-model:value="phone"
-             class="tableConditionInput"
-             placeholder="模糊搜索手机号码" />
+             placeholder="模糊搜索现货品种" />
     <a-button class="selectBtn"
               @click="search">查询</a-button>
     <a-button class="selectBtn"
@@ -32,33 +29,31 @@ import { defineComponent, ref, SetupContext } from 'vue';
 
 // 搜索
 function handleSearch(context: SetupContext) {
-    const nickname = ref<string>('');
-    const name = ref<string>('');
-    const phone = ref<string>('');
+    const hedgeplanno = ref<string>('');
+    const deliverygoodsname = ref<string>('');
     interface Value {
         key: string;
         value: string;
     }
     let useType = '';
-    const userinfotype = ref<number | undefined>(undefined);
+    const contracttype = ref<number | undefined>(undefined);
     function handleChange(value: Value) {
         useType = value.value;
         search();
     }
     function search() {
-        const result = { nickname: [nickname.value], name: [name.value], mobile: [phone.value], userinfotype: [useType] };
+        const result = { hedgeplanno: [hedgeplanno.value], deliverygoodsname: [deliverygoodsname.value], contracttype: [useType] };
         context.emit('search', result);
     }
     function reset() {
-        nickname.value = '';
-        name.value = '';
-        phone.value = '';
-        userinfotype.value = undefined;
+        hedgeplanno.value = '';
+        deliverygoodsname.value = '';
+        contracttype.value = undefined;
         useType = '';
         search();
     }
 
-    return { nickname, name, phone, search, reset, userinfotype, handleChange };
+    return { hedgeplanno, search, reset, contracttype, handleChange };
 }
 
 export default defineComponent({
@@ -104,6 +99,5 @@ export default defineComponent({
     .conditionSelect + .conditionSelect {
         margin-left: 10px;
     }
-    
 }
 </style>;

+ 11 - 0
src/views/business/plan/components/index.ts

@@ -0,0 +1,11 @@
+import Add from './add/index.vue';
+import Audit from './audit/index.vue';
+import Cancel from './cancel/index.vue';
+import Delete from './delete/index.vue';
+import Detail from './detail/index.vue';
+import Filter from './filterTable/index.vue';
+import Modfiy from './modify/index.vue';
+import Recommit from './recommit/index.vue';
+
+export { Add, Detail, Filter, Modfiy, Recommit, Delete, Cancel, Audit };
+

+ 4 - 4
src/views/business/plan/compoments/modify/index.vue → src/views/business/plan/components/modify/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <!-- 修改客户资料 -->
+  <!-- 修改计划 -->
   <a-modal class="commonModal modify-custom"
-           title="修改客户资料"
+           title="修改计划"
            v-if="visible"
            v-model:visible="visible"
            @cancel="cancel"
@@ -191,7 +191,7 @@ import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods/index';
 
 export default defineComponent({
-    name: 'modify-custom',
+    name: 'plan_uncommitted_modify',
     components: {},
     props: {
         // selectedRow: {
@@ -200,7 +200,7 @@ export default defineComponent({
     },
     setup() {
         // const { visible, cancel } = closeModal('modifyCustomInfo');
-        const { visible, cancel } = closeModal('custom_info_btn_modify');
+        const { visible, cancel } = closeModal('plan_uncommitted_modify');
 
         const loading = ref<boolean>(false);
         function submit() {

+ 6 - 6
src/views/business/plan/compoments/recover/index.vue → src/views/business/plan/components/recommit/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <!-- 恢复客户资料-->
-  <a-modal class="modify-custom"
-           title="恢复客户资料"
+  <!-- 计划 重新提交-->
+  <a-modal class="plan-recommit"
+           title="重新提交"
            v-model:visible="visible"
            @cancel="cancel"
            width="890px">
@@ -19,10 +19,10 @@ import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 
 export default defineComponent({
-    name: 'modify-custom',
+    name: 'plan-recommit',
     components: {},
     setup() {
-        const { visible, cancel } = closeModal('custom_info_btn_recover');
+        const { visible, cancel } = closeModal('plan_uncommitted_recommit');
         const loading = ref<boolean>(false);
         function submit() {
             loading.value = true;
@@ -42,7 +42,7 @@ export default defineComponent({
 </script>
 
 <style lang="less">
-.modify-custom {
+.plan-recommit {
 }
 </style
 >;

+ 54 - 36
src/views/business/plan/list/audit/index.vue

@@ -1,71 +1,89 @@
 <template>
-  <!-- 计划: 未提交-->
+  <!-- 计划: 审核中-->
   <div class="plan_uncommitted"
        :loading="loading">
-    <filterCustomTable @search="search">
+    <Filter @search="search">
       <BtnList :btnList="commonBtn" />
-    </filterCustomTable>
+    </Filter>
     <contextMenu :contextMenuList="forDataBtn">
       <a-table :columns="columns"
                class="topTable"
                :pagination="false"
-               rowKey="key"
                :expandedRowKeys="expandedRowKeys"
                :customRow="Rowclick"
-               :data-source="spotContractList">
+               rowKey="key"
+               :data-source="tableList">
         <!-- 额外的展开行 -->
         <template #expandedRowRender="{  }">
           <BtnList :btnList="forDataBtn" />
         </template>
-        <!-- <template #userinfotype="{ text }">
-          <a>{{ text === '2' ? '企业' : '个人'}}</a>
+        <!-- <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
         </template> -->
       </a-table>
     </contextMenu>
-    <!-- 现货合同: 详情 -->
-    <SpotContractDeatil />
-    <!-- 现货合同: 审核 -->
-    <Check />
-    <!-- 现货合同: 撤销 -->
+    <!-- 详情 -->
+    <Detail />
+    <!-- 撤销 -->
     <Cancel />
+    <!-- 审核 -->
+    <Audit />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { initData } from '@/common/methods';
-import filterCustomTable from '@/views/information/spot-contract/components/filterTable/index.vue';
-import { getCustomList } from '../setup';
-import contextMenu from '@/common/components/contextMenu/index.vue';
-import { MenuItem } from '@/common/components/contextMenu/interface';
-import AddSpotContract from '@/views/information/spot-contract/components/add/index.vue';
-import SpotContractDeatil from '@/views/information/spot-contract/components/detail/index.vue';
-import Check from '@/views/information/spot-contract/components/check/index.vue';
-import Cancel from '@/views/information/spot-contract/components/cancel/index.vue';
-import { getBtnList } from '@/common/setup/contextMenu/index';
-import { handleTableEvent } from '@/common/setup/event/index';
-import BtnList from '@/common/components/buttonList/index.vue';
+import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
+import { Add, Detail, Filter, Recommit, Cancel, Audit } from '../../components';
 
 export default defineComponent({
     name: 'plan_uncommitted',
     components: {
-        filterCustomTable,
         contextMenu,
-        AddSpotContract,
-        SpotContractDeatil,
-        Check,
-        Cancel,
         BtnList,
+        Add,
+        Recommit,
+        Filter,
+        Detail,
+        Audit,
+        Cancel,
     },
     setup() {
-        const contextMenuList = ref<MenuItem[]>([]);
-        const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
-
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        // 表格操作按钮列表
+        const { commonBtn, forDataBtn } = getBtnList('plan_audit', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList('1');
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
         initData(() => {
-            actionQuery(2);
-            getColumns();
+            // 获取列表数据
+            queryTable();
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_hedging_plan', getFilterTableCB);
         });
-        return { spotContractList, columns, search, contextMenuList, ...getBtnList('business_review_someprice', true), loading, ...handleTableEvent() };
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            commonBtn,
+            forDataBtn,
+            loading,
+            tableList,
+            search,
+        };
     },
 });
 </script>

+ 5 - 0
src/views/business/plan/list/index.ts

@@ -0,0 +1,5 @@
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
+import { getFilterTableCB, queryTableList } from './setup';
+
+export { queryTableList, getFilterTableCB };
+export type { Ermcp3HedgePlan };

+ 83 - 74
src/views/business/plan/list/running/index.vue

@@ -1,83 +1,92 @@
 <template>
-    <!-- 采购: 现货头寸-->
-    <div class="spot-contract-peddding">
-        采购: 现货头寸
-    </div>
+  <!-- 计划: 执行中-->
+  <div class="plan_running"
+       :loading="loading">
+    <Filter @search="search">
+      <BtnList :btnList="commonBtn" />
+    </Filter>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               rowKey="key"
+               :data-source="tableList">
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{  }">
+          <BtnList :btnList="forDataBtn" />
+        </template>
+        <!-- <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template> -->
+      </a-table>
+    </contextMenu>
+    <!-- 详情 -->
+    <Detail />
+    <!-- 撤销 -->
+    <Cancel />
+    <!-- 审核 -->
+    <Audit />
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, ref } from 'vue';
-    import { QueryCustomInfo } from '@/services/go/ermcp/customInfo/index';
-    import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-    import { message } from 'ant-design-vue';
-    import { initData } from '@/common/methods';
+import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
+import { Add, Detail, Filter, Recommit } from '../../components';
 
-    // 查询客户资料列表
-    function getCustomList() {
-        // const filteredInfo = ref();
-        // const sortedInfo = ref();
-        // const columns = computed(() => {
-        //     const filtered = filteredInfo.value || {};
-        //     const sorted = sortedInfo.value || {};
-        //     return [
-        //         {
-        //             title: '序号',
-        //             dataIndex: 'index',
-        //             key: 'index',
-        //             align: 'center',
-        //             width: 50,
-        //             customRender: (param: any) => `${param.index + 1}`,
-        //         },
-        //         {
-        //             title: 'Age',
-        //             dataIndex: 'age',
-        //             key: 'age',
-        //             sorter: (a: DataItem, b: DataItem) => a.age - b.age,
-        //             sortOrder: sorted.columnKey === 'age' && sorted.order,
-        //         },
-        //         {
-        //             title: 'Address',
-        //             dataIndex: 'address',
-        //             key: 'address',
-        //             filters: [
-        //                 { text: 'London', value: 'London' },
-        //                 { text: 'New York', value: 'New York' },
-        //             ],
-        //             filteredValue: filtered.address || null,
-        //             onFilter: (value: string, record: DataItem) => record.address.includes(value),
-        //             sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
-        //             sortOrder: sorted.columnKey === 'address' && sorted.order,
-        //             ellipsis: true,
-        //         },
-        //     ];
-        // });
-        const customList = ref<QueryCustomInfoType[]>([]);
-        function actionQuery() {
-            QueryCustomInfo(4)
-                .then((res) => {
-                    console.log('L', res);
-                })
-                .catch((err) => message.error(err));
+export default defineComponent({
+    name: 'spot-contract-peddding',
+    components: {
+        contextMenu,
+        BtnList,
+        Add,
+        Recommit,
+        Filter,
+        Detail,
+    },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        // 表格操作按钮列表
+        const { commonBtn, forDataBtn } = getBtnList('plan_running', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList('2');
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
         }
-
-        return { customList, actionQuery };
-    }
-
-    export default defineComponent({
-        name: 'spot-contract-peddding',
-        components: {},
-        setup() {
-            const { customList, actionQuery } = getCustomList();
-            initData(() => {
-                actionQuery();
-                // 加载数据在这里
-            });
-            return { customList };
-        },
-    });
+        initData(() => {
+            // 获取列表数据
+            queryTable();
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_hedging_plan', getFilterTableCB);
+        });
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            commonBtn,
+            forDataBtn,
+            loading,
+            tableList,
+            search,
+        };
+    },
+});
 </script>
 
 <style lang="less">
-    .spot-contract-peddding {
-    }</style
->;
+.plan_running {
+}
+</style>;

+ 39 - 69
src/views/business/plan/list/setup.ts

@@ -1,84 +1,54 @@
-import { ColumnType, getTableHead } from '@/common/methods/table';
-import { QuerySpotContract } from '@/services/go/ermcp/spot-contract/index';
-import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+import { Column, ColumnType } from '@/common/setup/table/index';
+import { QueryHedgePlan } from '@/services/go/ermcp/plan';
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 import { message } from 'ant-design-vue';
 import { ref } from 'vue';
 
-// 处理现货列表
-export function getCustomList() {
-    // 表格数据
-    const spotContractList = ref<Ermcp3ContractRsp[]>([]);
-    // 表头数据
-    const columns = ref<ColumnType[]>([]);
-    // 过滤项
-    const filteredInfo = ref();
+/**
+ * 获取表格列表数据
+ * @param type 
+ * @returns 
+ */
+export function queryTableList(type: string) {
+    // 加载状态
     const loading = ref<boolean>(false);
-    // 获取表头
-    function getColumns() {
-        const list = getTableHead('table_pcweb_delivery');
-        const filtered = filteredInfo.value || {};
-        columns.value.length = 0;
-        list.forEach((e, i) => {
-            const { columnfield, columntitle, aligntype } = e;
-            const item: ColumnType = {
-                key: String(i),
-                dataIndex: columnfield, // 表格数据对应的key
-                title: columntitle,
-                align: aligntype === 1 ? 'center' : aligntype === 2 ? 'left' : 'right',
-                slots: { customRender: columnfield },
-            };
-            // 以下添加过滤数据对应的方法
-            if (e.columntitle === '类型') {
-                item.onFilter = (value: string, record: Ermcp3ContractRsp) => String(record.contracttype).includes(value);
-                item.filteredValue = filtered.contracttype || null;
-            }
-            if (e.columntitle === '定价类型') {
-                item.onFilter = (value: string, record: Ermcp3ContractRsp) => String(record.pricetype).includes(value);
-                item.filteredValue = filtered.pricetype || null;
-            }
-            if (e.columntitle === '合同编号') {
-                item.onFilter = (value: string, record: Ermcp3ContractRsp) => record.contractno.includes(value);
-                item.filteredValue = filtered.contractno || null;
-            }
-            if (e.columntitle === '对手方') {
-                item.onFilter = (value: string, record: Ermcp3ContractRsp) => {
-                    if (record.contracttype === 1) {
-                        //采购方
-                        return record.sellusername.includes(value);
-                    } else {
-                        // 销售
-                        return record.buyusername.includes(value);
-                    }
-                };
-                item.filteredValue = filtered.negative || null;
-            }
-            columns.value.push(item);
-        });
-        console.log('columns', columns);
-    }
-    // 1-未提交 2-待审核 3-履约中 4-已完成
-    type EnumType = 1 | 2 | 3 | 4;
-    // 查询列表
-    function actionQuery(type: EnumType) {
-        loading.value = true;
-        QuerySpotContract({ querytype: type })
+    // 表格数据
+    const tableList = ref<Ermcp3HedgePlan[]>([]);
+    function queryTable() {
+        QueryHedgePlan(type)
             .then((res) => {
-                spotContractList.value = res.map((e, i) => {
+                tableList.value = res.map((e, i) => {
                     return { ...e, key: String(i) };
                 });
                 loading.value = false;
-                console.log('查询列表', spotContractList);
+                console.log('查询列表', tableList);
             })
             .catch((err) => {
                 message.error(err);
                 loading.value = false;
             });
     }
-    // 查询
-    function search(value: any) {
-        filteredInfo.value = value;
-        getColumns();
-    }
-
-    return { spotContractList, actionQuery, columns, filteredInfo, getColumns, search, loading };
+    return { loading, tableList, queryTable }
 }
+
+/**
+ * 过滤表格的回调函数
+ * @param e 
+ * @param item 
+ * @param filtered 
+ */
+export function getFilterTableCB(e: Column, item: ColumnType, filtered: any) {
+    // // 以下添加过滤数据对应的方法
+    if (e.columnfield === 'contracttype') {
+        item.onFilter = (value: string, record: Ermcp3HedgePlan) => String(record.contracttype).includes(String(value));
+        item.filteredValue = filtered.contracttype || null;
+    }
+    if (e.columnfield === 'hedgeplanno') {
+        item.onFilter = (value: string, record: Ermcp3HedgePlan) => record.hedgeplanno.includes(value);
+        item.filteredValue = filtered.hedgeplanno || null;
+    }
+    if (e.columnfield === 'deliverygoodsname') {
+        item.onFilter = (value: string, record: Ermcp3HedgePlan) => record.deliverygoodsname.includes(value);
+        item.filteredValue = filtered.deliverygoodsname || null;
+    }
+}

+ 89 - 74
src/views/business/plan/list/uncommitted/index.vue

@@ -1,83 +1,98 @@
 <template>
-    <!-- 采购: 实时敞口-->
-    <div class="purchase-real-time">
-        采购: 实时敞口
-    </div>
+  <!-- 计划: 未提交-->
+  <div class="plan-uncommitted"
+       :loading="loading">
+    <Filter @search="search">
+      <BtnList :btnList="commonBtn" />
+    </Filter>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               rowKey="key"
+               :data-source="tableList">
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{  }">
+          <BtnList :btnList="forDataBtn" />
+        </template>
+        <!-- <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template> -->
+      </a-table>
+    </contextMenu>
+    <!-- 详情 -->
+    <Detail />
+    <!-- 新增 -->
+    <Add />
+    <!-- 修改 -->
+    <Modfiy />
+    <!-- 重新提交 -->
+    <Recommit />
+    <!-- 删除-->
+    <Delete />
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, ref } from 'vue';
-    import { QueryCustomInfo } from '@/services/go/ermcp/customInfo/index';
-    import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-    import { message } from 'ant-design-vue';
-    import { initData } from '@/common/methods';
+import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
+import { Add, Delete, Detail, Filter, Modfiy, Recommit } from '../../components';
 
-    // 查询客户资料列表
-    function getCustomList() {
-        // const filteredInfo = ref();
-        // const sortedInfo = ref();
-        // const columns = computed(() => {
-        //     const filtered = filteredInfo.value || {};
-        //     const sorted = sortedInfo.value || {};
-        //     return [
-        //         {
-        //             title: '序号',
-        //             dataIndex: 'index',
-        //             key: 'index',
-        //             align: 'center',
-        //             width: 50,
-        //             customRender: (param: any) => `${param.index + 1}`,
-        //         },
-        //         {
-        //             title: 'Age',
-        //             dataIndex: 'age',
-        //             key: 'age',
-        //             sorter: (a: DataItem, b: DataItem) => a.age - b.age,
-        //             sortOrder: sorted.columnKey === 'age' && sorted.order,
-        //         },
-        //         {
-        //             title: 'Address',
-        //             dataIndex: 'address',
-        //             key: 'address',
-        //             filters: [
-        //                 { text: 'London', value: 'London' },
-        //                 { text: 'New York', value: 'New York' },
-        //             ],
-        //             filteredValue: filtered.address || null,
-        //             onFilter: (value: string, record: DataItem) => record.address.includes(value),
-        //             sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
-        //             sortOrder: sorted.columnKey === 'address' && sorted.order,
-        //             ellipsis: true,
-        //         },
-        //     ];
-        // });
-        const customList = ref<QueryCustomInfoType[]>([]);
-        function actionQuery() {
-            QueryCustomInfo(4)
-                .then((res) => {
-                    console.log('L', res);
-                })
-                .catch((err) => message.error(err));
+export default defineComponent({
+    name: 'plan-uncommitted',
+    components: {
+        contextMenu,
+        BtnList,
+        Add,
+        Modfiy,
+        Recommit,
+        Filter,
+        Detail,
+        Delete,
+    },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        // 表格操作按钮列表
+        const { commonBtn, forDataBtn } = getBtnList('plan_uncommitted', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList('0');
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
         }
-
-        return { customList, actionQuery };
-    }
-
-    export default defineComponent({
-        name: 'purchase-real-time',
-        components: {},
-        setup() {
-            const { customList, actionQuery } = getCustomList();
-            initData(() => {
-                actionQuery();
-                // 加载数据在这里
-            });
-            return { customList };
-        },
-    });
+        initData(() => {
+            // 获取列表数据
+            queryTable();
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_hedging_plan', getFilterTableCB);
+        });
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            commonBtn,
+            forDataBtn,
+            loading,
+            tableList,
+            search,
+        };
+    },
+});
 </script>
 
 <style lang="less">
-    .purchase-real-time {
-    }</style
->;
+.plan-uncommitted {
+}
+</style>;