Explorar el Código

修改业务审核 点价

huangbin hace 4 años
padre
commit
071bd59607

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

@@ -10,18 +10,22 @@ import {
 
 /**
  * 查询业务管理(结算)(对应菜单:业务管理/结算) /Ermcp/QueryBusinessJs
- * @param req.UserId 用户ID (必填)
+ * @param QueryBusinessJsReq 
  * @constructor
  */
 export function QueryBusinessJs(req: QueryBusinessJsReq): Promise<QryBussinessJsRsp[]> {
-    return commonSearch_go('/Ermcp/QueryBusinessJs', req).catch((err) => {
+    const param = {
+        UserId: getUserId(),
+    }
+    Object.assign(param, req)
+    return commonSearch_go('/Ermcp/QueryBusinessJs', param).catch((err) => {
         throw new Error(`业务管理 - 结算: ${err.message}`);
     });
 }
 
 /**
  * 查询业务管理(点价)(对应菜单:业务管理/点价) /Ermcp/QueryBusinessDj
- * @param req.UserId 用户ID (必填)
+ * @param QueryBusinessDjReq
  * @constructor
  */
 export function QueryBusinessDj(req: QueryBusinessDjReq): Promise<QryBusinessDjRsp[]> {

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

@@ -2,7 +2,6 @@
  * 查询业务管理 业务管理 - 结算  请求
  */
 export interface QueryBusinessJsReq {
-    UserId: number
     relatedid?: string  // 现货合同ID, 不填则查所有
     operateapplyid?: string  // 操作申请id
     applystatus?: string  // 申请状态(逗号隔开) 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回

+ 5 - 2
src/views/manage/business-review/list/settlement/index.vue

@@ -25,8 +25,11 @@
         </template>
       </a-table>
     </contextMenu>
+    <!-- 点价记录详情 -->
     <SettlementDetail />
+    <!-- 交收审核 -->
     <SettlementAudit />
+    <!-- 撤销点价登记 -->
     <SettlementCancel />
   </div>
 </template>
@@ -36,7 +39,7 @@ import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList,
 
 import { SettlementDetail, SettlementAudit, SettlementCancel, Filter } from '../../components';
 
-import { queryTableList, getFilterTableCB, QryBusinessDjRsp } from './setup';
+import { queryTableList, getFilterTableCB, QryBussinessJsRsp } from './setup';
 
 export default defineComponent({
     name: 'business-review-js',
@@ -52,7 +55,7 @@ export default defineComponent({
         // 表头数据
         const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QryBusinessDjRsp>({});
+        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QryBussinessJsRsp>({});
         // 表格操作按钮列表
         const { commonBtn, forDataBtn } = getBtnList('business_review_settlement', true);
         // 表格列表数据

+ 10 - 10
src/views/manage/business-review/list/settlement/setup.ts

@@ -1,6 +1,6 @@
 import { Column, ColumnType } from '@/common/setup/table/index';
-import { QueryBusinessDj } from '@/services/go/ermcp/business-review';
-import { QryBusinessDjRsp, QueryBusinessDjReq } from '@/services/go/ermcp/business-review/interface';
+import { QueryBusinessJs } from '@/services/go/ermcp/business-review';
+import { QryBussinessJsRsp, QueryBusinessJsReq } from '@/services/go/ermcp/business-review/interface';
 import { message } from 'ant-design-vue';
 import { ref } from 'vue';
 
@@ -9,13 +9,13 @@ import { ref } from 'vue';
  * @param type 
  * @returns 
  */
-export function queryTableList(type: QueryBusinessDjReq) {
+export function queryTableList(type: QueryBusinessJsReq) {
     // 加载状态
     const loading = ref<boolean>(false);
     // 表格数据
-    const tableList = ref<QryBusinessDjRsp[]>([]);
+    const tableList = ref<QryBussinessJsRsp[]>([]);
     function queryTable() {
-        QueryBusinessDj(type)
+        QueryBusinessJs(type)
             .then((res) => {
                 tableList.value = res.map((e, i) => {
                     return { ...e, key: String(i) };
@@ -40,11 +40,11 @@ export function queryTableList(type: QueryBusinessDjReq) {
 export function getFilterTableCB(e: Column, item: ColumnType, filtered: any) {
     // 以下添加过滤数据对应的方法
     if (e.columnfield === 'contracttype') {
-        item.onFilter = (value: string, record: QryBusinessDjRsp) => String(record.contracttype).includes(String(value));
+        item.onFilter = (value: string, record: QryBussinessJsRsp) => String(record.contracttype).includes(String(value));
         item.filteredValue = filtered.contracttype || null;
     }
     if (e.columnfield === 'buyusernameOrsellusername') {
-        item.onFilter = (value: string, record: QryBusinessDjRsp) => {
+        item.onFilter = (value: string, record: QryBussinessJsRsp) => {
             const { contracttype, buyusername, sellusername } = record
             if (contracttype === 1) {   // 采购
                 return sellusername.includes(value)
@@ -55,13 +55,13 @@ export function getFilterTableCB(e: Column, item: ColumnType, filtered: any) {
         item.filteredValue = filtered.buyusernameOrsellusername || null;
     }
     if (e.columnfield === 'contractno') {
-        item.onFilter = (value: string, record: QryBusinessDjRsp) => record.contractno.includes(value);
+        item.onFilter = (value: string, record: QryBussinessJsRsp) => record.contractno.includes(value);
         item.filteredValue = filtered.contractno || null;
     }
     if (e.columnfield === 'deliverygoodsname') {
-        item.onFilter = (value: string, record: QryBusinessDjRsp) => record.deliverygoodsname.includes(value);
+        item.onFilter = (value: string, record: QryBussinessJsRsp) => record.deliverygoodsname.includes(value);
         item.filteredValue = filtered.deliverygoodsname || null;
     }
 }
 
-export type { QryBusinessDjRsp };
+export type { QryBussinessJsRsp };

+ 45 - 27
src/views/manage/business-review/list/someprice/index.vue

@@ -2,9 +2,9 @@
   <!-- 管理-业务审核-点价 -->
   <div class="business-review-dj"
        :loading="loading">
-    <filterCustomTable @search="search">
+    <Filter @search="search">
       <BtnList :btnList="commonBtn" />
-    </filterCustomTable>
+    </Filter>
     <contextMenu :contextMenuList="forDataBtn">
       <a-table :columns="columns"
                class="topTable"
@@ -17,52 +17,71 @@
         <template #expandedRowRender="{  }">
           <BtnList :btnList="forDataBtn" />
         </template>
-        <!-- <template #warehousetype="{ text }">
+        <template #warehousetype="{ text }">
           <span>{{ getWareHouseType(text) }}</span>
         </template>
         <template #warehousestatus="{ text }">
           <span>{{ getWareHouseStatus(text) }}</span>
-        </template> -->
+        </template>
       </a-table>
     </contextMenu>
+    <!-- 点价记录详情 -->
+    <SomepriceDetail />
+    <!-- 点价审核 -->
+    <SomepriceAudit />
+    <!-- 撤销点价登记 -->
+    <SomepriceCancel />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent } from 'vue';
-import { initData } from '@/common/methods';
-import filterCustomTable from '@/views/information/warehouse-info/compoments/filterTable/index.vue';
-import { getTableList } from './setup';
-import { getBtnList } from '@/common/setup/contextMenu/index';
-import contextMenu from '@/common/components/contextMenu/index.vue';
-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 { Filter, SomepriceDetail, SomepriceAudit, SomepriceCancel } from '../../components';
+import { queryTableList, getFilterTableCB, QryBusinessDjRsp } from './setup';
 
 export default defineComponent({
-    name: 'warehouse-info-normal',
+    name: 'business-review-dj',
     components: {
         contextMenu,
-        filterCustomTable,
+        Filter,
         BtnList,
+        SomepriceDetail,
+        SomepriceAudit,
+        SomepriceCancel,
     },
     setup() {
-        const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList();
-        const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
-
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QryBusinessDjRsp>({});
+        // 表格操作按钮列表
+        const { commonBtn, forDataBtn } = getBtnList('business_review_someprice', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList({});
         initData(() => {
-            actionQuery();
-            getColumns();
+            // 获取列表数据
+            queryTable();
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_business_aduit_dj', getFilterTableCB);
         });
-
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
         return {
-            tableList,
-            filteredInfo,
             columns,
-            search,
-            loading,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
             commonBtn,
             forDataBtn,
-            ...handleTableEvent(),
+            loading,
+            tableList,
+            search,
         };
     },
 });
@@ -71,6 +90,5 @@ export default defineComponent({
 <style lang="less">
 .business-review-dj {
 }
-</style
->;
+</style>;
 

+ 48 - 51
src/views/manage/business-review/list/someprice/setup.ts

@@ -1,53 +1,21 @@
-import { ColumnType, getTableHead } from '@/common/methods/table';
-import { QueryBusinessDj } from '@/services/go/ermcp/business-review/index';
-import { QryBusinessDjRsp } from '@/services/go/ermcp/business-review/interface';
+import { Column, ColumnType } from '@/common/setup/table/index';
+import { QueryBusinessDj } from '@/services/go/ermcp/business-review';
+import { QryBusinessDjRsp, QueryBusinessDjReq } from '@/services/go/ermcp/business-review/interface';
 import { message } from 'ant-design-vue';
 import { ref } from 'vue';
 
-// 管理-业务审核-点价
-export function getTableList() {
+/**
+ * 获取表格列表数据
+ * @param type 
+ * @returns 
+ */
+export function queryTableList(type: QueryBusinessDjReq) {
+    // 加载状态
+    const loading = ref<boolean>(false);
     // 表格数据
     const tableList = ref<QryBusinessDjRsp[]>([]);
-    // 表头数据
-    const columns = ref<ColumnType[]>([]);
-    // 过滤项
-    const filteredInfo = ref();
-    const loading = ref<boolean>(false);
-
-    // 获取表头
-    function getColumns() {
-        const list = getTableHead('table_pcweb_business_aduit_dj');
-        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.columnfield === 'warehousetype') {
-            //     item.onFilter = (value: string, record: QryBusinessDjRsp) => String(record.warehousetype).includes(String(value));
-            //     item.filteredValue = filtered.warehousetype || null;
-            // }
-            // if (e.columnfield === 'warehousename') {
-            //     item.onFilter = (value: string, record: QryBusinessDjRsp) => record.warehousename.includes(value);
-            //     item.filteredValue = filtered.warehousename || null;
-            // }
-            // if (e.columnfield === 'address') {
-            //     item.onFilter = (value: string, record: QryBusinessDjRsp) => record.address.includes(value);
-            //     item.filteredValue = filtered.address || null;
-            // }
-            columns.value.push(item);
-        });
-    }
-    // 查询列表
-    function actionQuery() {
-        loading.value = true;
-        QueryBusinessDj({})
+    function queryTable() {
+        QueryBusinessDj(type)
             .then((res) => {
                 tableList.value = res.map((e, i) => {
                     return { ...e, key: String(i) };
@@ -60,11 +28,40 @@ export function getTableList() {
                 loading.value = false;
             });
     }
-    // 查询
-    function search(value: any) {
-        filteredInfo.value = value;
-        getColumns();
+    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: QryBusinessDjRsp) => String(record.contracttype).includes(String(value));
+        item.filteredValue = filtered.contracttype || null;
+    }
+    if (e.columnfield === 'buyusernameOrsellusername') {
+        item.onFilter = (value: string, record: QryBusinessDjRsp) => {
+            const { contracttype, buyusername, sellusername } = record
+            if (contracttype === 1) {   // 采购
+                return sellusername.includes(value)
+            } else {
+                return buyusername.includes(value)
+            }
+        };
+        item.filteredValue = filtered.buyusernameOrsellusername || null;
+    }
+    if (e.columnfield === 'contractno') {
+        item.onFilter = (value: string, record: QryBusinessDjRsp) => record.contractno.includes(value);
+        item.filteredValue = filtered.contractno || null;
+    }
+    if (e.columnfield === 'deliverygoodsname') {
+        item.onFilter = (value: string, record: QryBusinessDjRsp) => record.deliverygoodsname.includes(value);
+        item.filteredValue = filtered.deliverygoodsname || null;
     }
+}
 
-    return { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading, };
-}
+export type { QryBusinessDjRsp };