Browse Source

销售: 待点价-

huangbin 4 năm trước cách đây
mục cha
commit
5d9c206165

+ 13 - 9
src/views/business/sell/components/someprice/index.vue

@@ -48,7 +48,8 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="合同签署量">
-              <span class="white">{{ formatValue(selectedRow.qty + selectedRow.enumdicname) }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.qty + selectedRow.enumdicname) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -60,7 +61,8 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="点价合约">
-              <span class="white">{{ formatValue(selectedRow.goodsname) + selectedRow.currencyname }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.goodsname) + selectedRow.currencyname }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -77,7 +79,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="已点均价">
-              <span class="white">{{ formatValue(selectedRow.pricedavg)  + selectedRow.currencyname }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.pricedavg)  + selectedRow.currencyname }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -126,7 +129,9 @@
                               :max="selectedRow.unpricedqty"
                               placeholder="请输入点价数量" />
               <div class="tip mt10">
-                <span>未定价量<span class="white">{{ selectedRow.unpricedqty }}{{ selectedRow.enumdicname }}</span> </span>
+                <span>未定价量<span
+                        class="white">{{ selectedRow.unpricedqty }}{{ selectedRow.enumdicname }}</span>
+                </span>
                 <a class="blue ml10"
                    @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</a>
               </div>
@@ -150,17 +155,17 @@
 
 <script lang="ts">
 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 '@/common/constants/enumsName';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'sell_pending_someprice',
-    components: {},
+    emits: ['cancel'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3SellBuyContract>,
@@ -168,7 +173,7 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('sell_pending_someprice');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleForm();
         function submit() {
@@ -182,8 +187,7 @@ export default defineComponent({
                 // 发出点价请求
                 somePriceReq(props.selectedRow.spotcontractid, params, loading)
                     .then((res) => {
-                        cancel();
-                        context.emit('refresh');
+                        cancel(true);
                     })
                     .catch((err) => {});
             });

+ 48 - 46
src/views/business/sell/list/pending/index.vue

@@ -3,71 +3,73 @@
   <div class="sell-peddding"
        :loading="loading">
     <filterCustomTable @search="updateColumn">
-      <BtnList :btnList="commonBtn" />
+      <BtnList :btnList="firstBtn"
+               @click="openComponent" />
     </filterCustomTable>
-    <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>
-      </a-table>
+    <a-table :columns="columns"
+             class="srcollYTable"
+             :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="secondBtn"
+                 :record="record"
+                 @click="openComponent" />
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="secondBtn">
     </contextMenu>
-    <!-- 详情 -->
-    <Detail :selectedRow="selectedRow"
-            @refresh="queryTable" />
-    <!-- 采购点价登记 -->
-    <SomePrice :selectedRow="selectedRow"
-               @refresh="queryTable" />
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { queryTableList, Ermcp3SellBuyContract } from '../index';
-import { filterCustomTable, Detail, SomePrice } from '../../components';
+import { queryTableList, BtnList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
+import { QueryWareHouse } from '@/services/go/ermcp/sell';
+import { Ermcp3SellBuyContract } from '@/views/business/purchase/list';
+
+import { filterCustomTable } from '../../components';
+const Detail = defineAsyncComponent(() => import('../../components/detail/index.vue'));
+const SomePrice = defineAsyncComponent(() => import('../../components/someprice/index.vue')); //采购点价登记
 
 export default defineComponent({
     name: 'sell-peddding',
     components: {
         contextMenu,
         filterCustomTable,
-        Detail,
-        SomePrice,
         BtnList,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.sell_pending_someprice]: SomePrice,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3SellBuyContract>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('sell_pending', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(2);
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3SellBuyContract>();
+        // 获取列表数据
+        const queryTableAction = () => queryTable(QueryWareHouse, { querytype: 2 });
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: 'sell_pending',
+            tableName: 'table_pcweb_sales_pointprice',
+            tableFilterKey: ['accountname', 'contractno', 'deliverygoodsname', 'convertfactor', 'goodsname'],
+            isDetail: true,
+        };
 
-        initData(() => {
-            // 获取列表数据
-            queryTable();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_sales_pointprice', ['accountname', 'contractno', 'deliverygoodsname', 'convertfactor', 'goodsname']);
-        });
         return {
-            columns,
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            forDataBtn,
-            loading,
+            ...handleComposeTable<Ermcp3SellBuyContract>(param),
             tableList,
-            updateColumn,
+            loading,
         };
     },
 });