Prechádzať zdrojové kódy

修改采购 点价

huangbin 4 rokov pred
rodič
commit
a227e325b3

+ 8 - 0
src/common/constants/buttonType.ts

@@ -19,4 +19,12 @@ export interface ButtonType {
     warehouse_info_btn_modify: string; // 现货合同 修改
     warehouse_info_btn_disable: string; // 现货合同 停用
     warehouse_info_btn_recover: string; // 现货合同 恢复
+
+    purchase_pending_someprice: string; // 采购 点价登记
+    purchase_pending_settlement: string; // 采购 交收登记
+    purchase_pending_funds: string; // 采购 款项登记
+    purchase_pending_invoice: string; // 采购 发票登记
+    purchase_pending_storage: string; // 采购 入库登记
+
+
 }

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

@@ -17,4 +17,6 @@ export interface TableKey {
     table_pcweb_userinfo: string; // 客户资料
     table_pcweb_warehouse: string; // 仓库信息
     table_pcweb_purchase: string; // 采购合同
+    table_pcweb_sell: string; // 销售合同
+    table_pcweb_exposure: string; // 实时敞口
 }

+ 6 - 1
src/common/setup/buttonPermission/interface.ts

@@ -1,14 +1,19 @@
 export interface MenuType {
     custom_info_normal: string; // 客户资料 正常
     custom_info_disabled: string; // 客户资料 停用
-    purchase_pending: string;
+
     spot_contract_unsubmitted: string; // 现货合同 未提交
     spot_contract_checkpending: string; // 现货合同 待审核
     spot_contract_performance: string; // 现货合同 履约中
     spot_contract_finished: string; // 现货合同 已完成
+
     warehouse_info_normal: string; // 仓库信息 正常
     warehouse_info_disabled: string; // 仓库信息 停用
 
+    purchase_pending: string;   // 采购 待点价
+    purchase_performance: string;   // 采购 履约交收
+    purchase_all: string;   // 采购 全部
+
 }
 
 export interface BtnType {

+ 9 - 4
src/services/go/ermcp/purchase/index.ts

@@ -1,19 +1,24 @@
+import APP from '@/services';
+import { getUserId } from '@/services/bus/account';
 import { commonSearch_go } from '@/services/go';
 import { Ermcp3SellBuyContract, SellBuyContractReq } from '@/services/go/ermcp/purchase/interface';
 
 /** ================================= 采购 ================================**/
 /**
  * 查询采购信息(这个接口和销售是同一个接口) /Ermcp3/QuerySpotContractBS
- * @param req.areauserid 所属机构ID (必填)
- * @param req.contracttype 合同类型 1-采购, -1-销售 (必填)
  * @param req.querytype 查询类型 1-全部 2-待点价 3-履约结算 4-已完成 (必填)
- * @param req.userid 用户id
  * @param req.usertype 用户类型 2-机构 7-企业成员
  * @param req.contractid 合同ID(SpotContractId)
  * @constructor
  */
 export function QueryPurchase(req: SellBuyContractReq): Promise<Ermcp3SellBuyContract[]> {
-    return commonSearch_go('/Ermcp3/QuerySpotContractBS', req).catch((err) => {
+    const param = {
+        userid: getUserId(),
+        areauserid: APP.get('userAccount').memberuserid, // 所属机构id
+        contracttype: 1, // 采购
+    }
+    Object.assign(param, req)
+    return commonSearch_go('/Ermcp3/QuerySpotContractBS', param).catch((err) => {
         throw new Error(`查询采购信息: ${err.message}`);
     });
 }

+ 59 - 60
src/services/go/ermcp/purchase/interface.ts

@@ -1,11 +1,10 @@
 /**
  * 查询合同请求
  */
-export interface SellBuyContractReq{
-    areauserid: number  //  所属机构ID
-    contracttype: number // 合同类型 1-采购, -1-销售
-    querytype: number // 查询类型 1-全部 2-待点价 3-履约结算 4-已完成
-    userid?: number // 用户ID
+
+export type Querytype = 1 | 2 | 3 | 4;
+export interface SellBuyContractReq {
+    querytype: Querytype // 查询类型 1-全部 2-待点价 3-履约结算 4-已完成
     usertype?: number // 用户类型 2-机构 7-企业成员
     contractid?: string // 合同ID(SpotContractId)
 }
@@ -13,59 +12,59 @@ export interface SellBuyContractReq{
 /**
  * 查询合同返回
  */
-export interface Ermcp3SellBuyContract{
-    accountname	:string;//账户名称
-    attachment	:string;//附件
-    audittime	:string;//审核时间
-    brandname	:string;//品牌名称
-    contracctstatus	:number;//合同状态- number;
-//:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
-    contractmargin	:number;//合同保证金
-    contractno	:string;//合同编号
-    contracttype	:number;//合同类型 1-采购, -1-销售
-    convertfactor	:number;//标仓系数(品类)
-    createtime	:string;//创建时间
-    daikaiamount	:number;//应收(开)票额
-    deliveryenddate	:string;//交割结束日
-    deliverygoodscode	:string;//现货品种代码
-    deliverygoodsid	:number;//现货商品ID
-    deliverygoodsname	:string;//现货品种名称
-    deliverystartdate	:string;//交割开始日
-    enddate	:string;//点价结束日
-    enumdicname	:string;//单位名称
-    goodscode	:string;//点价商品代码
-    goodsid	:number;//点价商品ID
-    goodsname	:string;//点价商品名称
-    invoiceamount	:number;//已开票额
-    loanamount	:number;//贷款总额=已定价额+调整金额
-    margin	:number;//保证金
-    nickname	:string;//账户昵称
-    payamount	:number;//已收付额(收款或付款)
-    preinvoiceamount	:number;//预收(开)票额
-    prepayamount	:number;//预收付额
-    price	:number;//价格
-    pricedamount	:number;//已定价额
-    pricedavg	:number;//已点均价
-    pricedqty	:number;//已定价量
-    pricemove	:number;//升贴水
-    pricetype	:number;//定价类型 - 1:一口价 2:点价 3:暂定价
-    producttype	:number;//产品类型 - 1:标准仓单 2:等标 3:非标
-    qty	:number;//合同量
-    reckonadjustamount	:number;//调整金额
-    reckonedamount	:number;//实际已收付额(已确定额,已收付总额-已退款总额)
-    reckonotheramount	:number;//其它费用
-    reckonrealqty	:number;//已确定量
-    remark	:string;//备注
-    spotcontractid	:string;//合同ID
-    spotgoodsbrandid	:number;//现货品牌ID(DGFactoryItem表的ID)
-    spotgoodsdesc	:string;//商品型号(商品规格)
-    startdate	:string;//点价开始日
-    totalamount	:number;//合计总额
-    unpayamount	:number;//应收付款额(应支付或应收款)
-    unpricedqty	:number;//未定价量
-    unsureqty	:number;//未确定量
-    userid	:number;//机构ID
-    wrstandardcode	:string;//品类代码
-    wrstandardid	:number;//品类ID
-    wrstandardname	:string;//品类名称
+export interface Ermcp3SellBuyContract {
+    accountname: string;//账户名称
+    attachment: string;//附件
+    audittime: string;//审核时间
+    brandname: string;//品牌名称
+    contracctstatus: number;//合同状态- number;
+    //:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+    contractmargin: number;//合同保证金
+    contractno: string;//合同编号
+    contracttype: number;//合同类型 1-采购, -1-销售
+    convertfactor: number;//标仓系数(品类)
+    createtime: string;//创建时间
+    daikaiamount: number;//应收(开)票额
+    deliveryenddate: string;//交割结束日
+    deliverygoodscode: string;//现货品种代码
+    deliverygoodsid: number;//现货商品ID
+    deliverygoodsname: string;//现货品种名称
+    deliverystartdate: string;//交割开始日
+    enddate: string;//点价结束日
+    enumdicname: string;//单位名称
+    goodscode: string;//点价商品代码
+    goodsid: number;//点价商品ID
+    goodsname: string;//点价商品名称
+    invoiceamount: number;//已开票额
+    loanamount: number;//贷款总额=已定价额+调整金额
+    margin: number;//保证金
+    nickname: string;//账户昵称
+    payamount: number;//已收付额(收款或付款)
+    preinvoiceamount: number;//预收(开)票额
+    prepayamount: number;//预收付额
+    price: number;//价格
+    pricedamount: number;//已定价额
+    pricedavg: number;//已点均价
+    pricedqty: number;//已定价量
+    pricemove: number;//升贴水
+    pricetype: number;//定价类型 - 1:一口价 2:点价 3:暂定价
+    producttype: number;//产品类型 - 1:标准仓单 2:等标 3:非标
+    qty: number;//合同量
+    reckonadjustamount: number;//调整金额
+    reckonedamount: number;//实际已收付额(已确定额,已收付总额-已退款总额)
+    reckonotheramount: number;//其它费用
+    reckonrealqty: number;//已确定量
+    remark: string;//备注
+    spotcontractid: string;//合同ID
+    spotgoodsbrandid: number;//现货品牌ID(DGFactoryItem表的ID)
+    spotgoodsdesc: string;//商品型号(商品规格)
+    startdate: string;//点价开始日
+    totalamount: number;//合计总额
+    unpayamount: number;//应收付款额(应支付或应收款)
+    unpricedqty: number;//未定价量
+    unsureqty: number;//未确定量
+    userid: number;//机构ID
+    wrstandardcode: string;//品类代码
+    wrstandardid: number;//品类ID
+    wrstandardname: string;//品类名称
 }

+ 10 - 5
src/services/go/ermcp/sell/index.ts

@@ -1,19 +1,24 @@
 /** ================================= 销售 ================================**/
-import { Ermcp3SellBuyContract, SellBuyContractReq } from '@/services/go/ermcp/purchase/interface';
+import APP from '@/services';
+import { getUserId } from '@/services/bus/account';
 import { commonSearch_go } from '@/services/go';
+import { Ermcp3SellBuyContract, SellBuyContractReq } from '@/services/go/ermcp/purchase/interface';
 
 /**
  * 查询销售信息(这个接口和采购是同一个接口) /Ermcp3/QuerySpotContractBS
- * @param req.areauserid 所属机构ID (必填)
- * @param req.contracttype 合同类型 1-采购, -1-销售 (必填)
  * @param req.querytype 查询类型 1-全部 2-待点价 3-履约结算 4-已完成 (必填)
- * @param req.userid 用户id
  * @param req.usertype 用户类型 2-机构 7-企业成员
  * @param req.contractid 合同ID(SpotContractId)
  * @constructor
  */
 export function QueryWareHouse(req: SellBuyContractReq): Promise<Ermcp3SellBuyContract[]> {
-    return commonSearch_go('/Ermcp3/QuerySpotContractBS', req).catch((err) => {
+    const param = {
+        userid: getUserId(),
+        areauserid: APP.get('userAccount').memberuserid, // 所属机构id
+        contracttype: -1, // 销售
+    }
+    Object.assign(param, req)
+    return commonSearch_go('/Ermcp3/QuerySpotContractBS', param).catch((err) => {
         throw new Error(`查询销售信息: ${err.message}`);
     });
 }

+ 6 - 5
src/services/go/ermcp/warehouse-info/index.ts

@@ -1,15 +1,16 @@
 /** ================================= 仓库信息 ================================**/
+import { getUserId } from '@/services/bus/account';
 import { commonSearch_go } from '@/services/go';
-import { Ermcp3AreaStock, ErmcpWareHouseInfo, WareHouseInfoReq } from '@/services/go/ermcp/warehouse-info/interface';
+import { Ermcp3AreaStock, ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
 
 /**
  * 查询仓库信息 /Ermcp/QueryWarehouseInfo
- * @param req.userid 用户id(必填)
- * @param req.status 仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝
+ * @param status 仓库状态(可多项,逗号隔开) 1:正常 2:注销 3:待审核 4:审核拒绝
  * @constructor
  */
-export function QueryWareHouse(req: WareHouseInfoReq): Promise<ErmcpWareHouseInfo[]> {
-    return commonSearch_go('/Ermcp/QueryWarehouseInfo', req).catch((err) => {
+export function QueryWareHouse(status: string): Promise<ErmcpWareHouseInfo[]> {
+    const userid = getUserId()
+    return commonSearch_go('/Ermcp/QueryWarehouseInfo', { userid, status }).catch((err) => {
         throw new Error(`查询仓库信息: ${err.message}`);
     });
 }

+ 46 - 0
src/views/business/purchase/components/detail/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 采购详情-->
+  <a-modal class="custom-detail"
+           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';
+
+export default defineComponent({
+    name: 'custom-detail',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('detail');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 131 - 0
src/views/business/purchase/components/filterTable/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <div class="filter-custom-table">
+    <a-input v-model:value="accountname"
+             class="tableConditionInput"
+             placeholder="模糊搜索销售方" />
+    <a-input v-model:value="contractno"
+             class="tableConditionInput"
+             placeholder="模糊搜索合同编号" />
+    <a-input v-model:value="deliverygoodsname"
+             class="tableConditionInput"
+             placeholder="模糊搜索现货品种" />
+    <a-input v-model:value="convertfactor"
+             class="tableConditionInput"
+             placeholder="模糊搜索品类" />
+    <a-input v-model:value="goodsname"
+             class="tableConditionInput"
+             placeholder="模糊搜索点价合约" />
+    <a-button class="selectBtn"
+              @click="search">查询</a-button>
+    <a-button class="selectBtn"
+              @click="reset">重置</a-button>
+    <slot></slot>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref, SetupContext } from 'vue';
+
+// 搜索
+function handleSearch(context: SetupContext) {
+    const accountname = ref<string>('');
+    const contractno = ref<string>('');
+    const deliverygoodsname = ref<string>('');
+    const convertfactor = ref<string>('');
+    const goodsname = ref<string>('');
+
+    function search() {
+        const result = {
+            accountname: [accountname.value],
+            contractno: [contractno.value],
+            deliverygoodsname: [deliverygoodsname.value],
+            convertfactor: [convertfactor.value],
+            goodsname: [goodsname.value],
+        };
+        context.emit('search', result);
+    }
+    function reset() {
+        accountname.value = '';
+        contractno.value = '';
+        deliverygoodsname.value = '';
+        convertfactor.value = '';
+        goodsname.value = '';
+        search();
+    }
+
+    return { accountname, contractno, convertfactor, goodsname, search, reset };
+}
+
+export default defineComponent({
+    name: 'filter-custom-table',
+    components: {},
+    setup(props, context) {
+        return {
+            ...handleSearch(context),
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.filter-custom-table {
+    width: 100%;
+    display: inline-flex;
+    padding-top: 9px;
+    padding-bottom: 6px;
+    .ant-select-single:not(.ant-select-customize-input) {
+        margin-right: 10px;
+        // background: #252D34;
+        // .rounded-corners(3px);
+        .ant-select-selector {
+            height: 30px;
+            padding: 0 8px;
+            background: @m-grey9;
+            border: none;
+            .rounded-corners(3px);
+            color: @m-grey10;
+            .ant-select-arrow {
+                right: 8px;
+                color: @m-grey1;
+            }
+        }
+        .ant-select-arrow {
+            color: @m-grey1;
+        }
+        .ant-select-selection-item {
+            color: @m-white1;
+        }
+    }
+    .conditionSelect + .conditionSelect {
+        margin-left: 10px;
+    }
+}
+.selectBtn.ant-btn {
+    margin-left: 10px;
+    width: 80px;
+    height: 30px;
+    line-height: 31px;
+    text-align: center;
+    background: linear-gradient(0deg, @m-grey15 0%, @m-grey16 98%);
+    border: 0;
+    color: @m-white0;
+    font-size: 14px;
+    .rounded-corners(3px);
+    &:hover,
+    &:focus {
+        background: linear-gradient(0deg, @m-grey15-hover 0%, @m-grey16-hover 98%);
+        color: rgba(@m-white0, 0.8);
+        border: 0;
+    }
+}
+.operBtn.ant-btn:extend(.selectBtn.ant-btn) {
+    background: linear-gradient(0deg, @m-blue6 0%, @m-blue7 99%);
+    &:hover,
+    &:focus {
+        background: linear-gradient(0deg, @m-blue6-hover 0%, @m-blue7-hover 99%);
+        color: rgba(@m-white0, 0.8);
+        border: 0;
+    }
+}
+</style>;

+ 46 - 0
src/views/business/purchase/components/someprice/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 采购点价登记-->
+  <a-modal class="custom-detail"
+           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';
+
+export default defineComponent({
+    name: 'custom-detail',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('purchase_pending_someprice');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 69 - 19
src/views/business/purchase/list/pending/index.vue

@@ -1,27 +1,77 @@
 <template>
-    <!-- 采购: 待点价-->
-    <div class="purchase-peddding" :loading="loading">
-        <!-- <filterCustomTable @search="search">
-            <a-button class="operBtn" v-if="hasPermission('custom_info_btn_add')" @click="addAction">新增</a-button>
-        </filterCustomTable> -->
-        <contextMenu :contextMenuList="contextMenuList" :tableList="customList">
-            <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :data-source="customList"></a-table>
-        </contextMenu>
-    </div>
+  <!-- 采购: 待点价-->
+  <div class="purchase-peddding"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="forDataBtn"
+                 :tableList="tableList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="tableList">
+        <!-- <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template> -->
+      </a-table>
+    </contextMenu>
+    <!-- 详情 -->
+    <Detail />
+    <!-- 采购点价登记 -->
+    <SomePrice />
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, ref } from 'vue';
-    import { handlePurchase, btnAndComp } from '../../setup';
-    export default defineComponent({
-        name: 'purchase-peddding',
-        setup() {
-            return { ...handlePurchase(), ...btnAndComp() };
-        },
-    });
+import { defineComponent } from 'vue';
+import { initData } from '@/common/methods';
+import filterCustomTable from '../../components/filterTable/index.vue';
+import { getTableList } from '../setup';
+import { getBtnList } from '@/common/setup/contextMenu/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import Detail from '../../components/detail/index.vue';
+import SomePrice from '../../components/someprice/index.vue';
+
+export default defineComponent({
+    name: 'purchase-peddding',
+    components: {
+        contextMenu,
+        filterCustomTable,
+        Detail,
+        SomePrice,
+    },
+    setup() {
+        const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList();
+        const { commonBtn, forDataBtn } = getBtnList('purchase_pending');
+
+        initData(() => {
+            actionQuery(2);
+            getColumns();
+        });
+
+        return {
+            tableList,
+            filteredInfo,
+            columns,
+            search,
+            loading,
+            commonBtn,
+            forDataBtn,
+        };
+    },
+});
 </script>
 
 <style lang="less">
-    .spot-contract-peddding {
-    }</style
+.spot-contract-peddding {
+}
+</style
 >;

+ 77 - 0
src/views/business/purchase/list/setup.ts

@@ -0,0 +1,77 @@
+import { ColumnType, getTableHead } from '@/common/methods/table';
+import { QueryPurchase } from '@/services/go/ermcp/purchase/index';
+import { Ermcp3SellBuyContract, Querytype } from '@/services/go/ermcp/purchase/interface';
+import { message } from 'ant-design-vue';
+import { ref } from 'vue';
+
+// 列表
+export function getTableList() {
+    // 表格数据
+    const tableList = ref<Ermcp3SellBuyContract[]>([]);
+    // 表头数据
+    const columns = ref<ColumnType[]>([]);
+    // 过滤项
+    const filteredInfo = ref();
+    const loading = ref<boolean>(false);
+    // 获取表头
+    function getColumns() {
+        const list = getTableHead('table_pcweb_purchase');
+        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 === 'accountname') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => record.accountname.includes(value);
+                item.filteredValue = filtered.accountname || null;
+            }
+            if (e.columnfield === 'contractno') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => record.contractno.includes(value);
+                item.filteredValue = filtered.contractno || null;
+            }
+            if (e.columnfield === 'deliverygoodsname') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => record.deliverygoodsname.includes(value);
+                item.filteredValue = filtered.deliverygoodsname || null;
+            }
+            if (e.columnfield === 'convertfactor') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => String(record.convertfactor).includes(value);
+                item.filteredValue = filtered.convertfactor || null;
+            }
+            if (e.columnfield === 'goodsname') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => record.goodsname.includes(value);
+                item.filteredValue = filtered.goodsname || null;
+            }
+            columns.value.push(item);
+        });
+    }
+    // 查询列表
+    function actionQuery(querytype: Querytype) {
+        loading.value = true;
+        QueryPurchase({ querytype })
+            .then((res) => {
+                tableList.value = res.map((e, i) => {
+                    return { ...e, key: String(i) };
+                });
+                loading.value = false;
+                console.log('查询列表', tableList);
+            })
+            .catch((err) => {
+                message.error(err);
+                loading.value = false;
+            });
+    }
+    // 查询
+    function search(value: any) {
+        filteredInfo.value = value;
+        getColumns();
+    }
+
+    return { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading, };
+}

+ 0 - 79
src/views/business/purchase/setup.ts

@@ -1,79 +0,0 @@
-// import { QueryPurchase } from '@/services/go/ermcp/purchase';
-import { MenuItem } from '@/common/components/contextMenu/interface';
-import { initData } from '@/common/methods';
-import { ColumnType, getTableHead } from '@/common/methods/table';
-import { handlePermission } from '@/common/setup/buttonPermission/index';
-import APP from '@/services';
-import { getUserId } from '@/services/bus/account';
-import { Ermcp3SellBuyContract, SellBuyContractReq } from '@/services/go/ermcp/purchase/interface';
-import { ref } from '@vue/reactivity';
-import { watchEffect } from 'vue';
-// 采购数据获取和表头数据整理
-export function handlePurchase() {
-    // ========================loading========================
-    const loading = ref<boolean>(false);
-    // ========================获取列表数据========================
-    let customList = ref<Ermcp3SellBuyContract[] | []>([]);
-    function queryPurchase() {
-        const AreaUserID = APP.get('userAccount').memberuserid; // 所属机构id
-        const req: SellBuyContractReq = {
-            areauserid: AreaUserID, //  所属机构ID
-            contracttype: 1, // 合同类型 1-采购, -1-销售
-            querytype: 1, // 查询类型 1-全部 2-待点价 3-履约结算 4-已完成
-            userid: getUserId(), // 用户ID
-        };
-        // QueryPurchase(req).then((res) => {
-        //     customList.value = res;
-        // });
-    }
-
-    // ========================获取表头========================
-    const columns = ref<ColumnType[]>([]);
-    function getColumns() {
-        const list = getTableHead('table_pcweb_purchase');
-        columns.value.length = 0;
-        list.forEach((e, i) => {
-            const { columnfield, columntitle, aligntype } = e;
-            const item: ColumnType = {
-                key: String(i),
-                dataIndex: columnfield,
-                title: columntitle,
-                align: aligntype === 1 ? 'center' : aligntype === 2 ? 'left' : 'right',
-                slots: { customRender: columnfield },
-            };
-            columns.value.push(item);
-        });
-    }
-
-    // ========================数据初始化========================
-    initData((): void => {
-        queryPurchase();
-        getColumns();
-    });
-    return { loading, customList, columns };
-}
-
-// 按钮权限与功能组件
-export function btnAndComp() {
-    // 传入父及的code 得到当前1234级的整个权限
-    const { hasPermission } = handlePermission('purchase_pending');
-    // 配置右键菜单列表
-    const contextMenuList = ref<MenuItem[]>([]);
-    // 打开新增页的弹窗 返回打开弹窗的方法
-    // const { openAction: addAction } = openModal('addCustomInfo');
-    // // 创建详情页并写入右键菜单列表(每个页面都有,写死)
-    // detailButton('customDetail', contextMenuList);
-    // // 通过code跟弹窗建立联系 返回写入右键的方法
-    // const { action: deleteAction } = permissionButton('purchase_pending_someprice', '点价登记', contextMenuList);
-
-    const stop = watchEffect(() => {
-        // 判断是否有权限 有就写入
-        // hasPermission('custom_info_btn_delete') && deleteAction();
-    });
-    return {
-        stop,
-        // addAction,
-        hasPermission,
-        contextMenuList,
-    };
-}

+ 0 - 8
src/views/information/warehouse-info/list/normal-use/index.vue

@@ -59,7 +59,6 @@ export default defineComponent({
     setup() {
         const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList();
         const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal');
-        console.log('forDataBtn', forDataBtn);
 
         initData(() => {
             actionQuery('1');
@@ -87,10 +86,3 @@ export default defineComponent({
 </style
 >;
 
-function getTableList(): {} {
-  throw new Error('Function not implemented.');
-}
-
-function getTableList(): { tableList: any; actionQuery: any; columns: any; filteredInfo: any; getColumns: any; search: any; loading: any; } {
-  throw new Error('Function not implemented.');
-}

+ 1 - 3
src/views/information/warehouse-info/list/setup.ts

@@ -1,5 +1,4 @@
 import { ColumnType, getTableHead } from '@/common/methods/table';
-import { getUserId } from '@/services/bus/account';
 import { QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
 import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
 import { message } from 'ant-design-vue';
@@ -47,8 +46,7 @@ export function getTableList() {
     // 查询列表
     function actionQuery(status: string) {
         loading.value = true;
-        const reqParam = { userid: getUserId(), status };
-        QueryWareHouse(reqParam)
+        QueryWareHouse(status)
             .then((res) => {
                 tableList.value = res.map((e, i) => {
                     return { ...e, key: String(i) };