Kaynağa Gözat

销售: 履约交收-

huangbin 4 yıl önce
ebeveyn
işleme
c7541ba9fc

+ 1 - 1
src/common/setup/table/clolumn.ts

@@ -116,7 +116,7 @@ function getFromatterFn(val: string) {
             break
         default:
             if (first) {
-                console.error(`请开发人员配置${first}格式化函数!`)
+                console.warn(`请开发人员配置${first}格式化函数!`)
             }
             break
     }

+ 6 - 4
src/views/business/sell/components/detail/index.vue

@@ -42,7 +42,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">
@@ -94,13 +95,14 @@
 
 <script lang="ts">
 import { defineComponent, PropType, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
 import { formatValue } from '@/common/methods';
 import { getPriceTypeName } from '@/common/constants/enumsName';
 import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'sell-detail',
+    emits: ['cancel'],
     components: {},
     props: {
         selectedRow: {
@@ -108,8 +110,8 @@ export default defineComponent({
             default: {},
         },
     },
-    setup() {
-        const { visible, cancel } = closeModal('detail');
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         function submit() {
             cancel();

+ 10 - 8
src/views/business/sell/components/funds/index.vue

@@ -47,7 +47,8 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="暂定价货款总额">
-              <span class="white">{{ selectedRow.pricetype === 3 ? formatValue(selectedRow.loanamount) : 0 }}</span>
+              <span
+                    class="white">{{ selectedRow.pricetype === 3 ? formatValue(selectedRow.loanamount) : 0 }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -73,7 +74,8 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="货款总额">
-              <span class="white">{{ selectedRow.pricedamount + selectedRow.reckonadjustamount }}</span>
+              <span
+                    class="white">{{ selectedRow.pricedamount + selectedRow.reckonadjustamount }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -163,17 +165,18 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, reactive, ref, unref, watch, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import { formatValue, initData } from '@/common/methods';
+import { defineComponent, PropType, ref, unref } from 'vue';
+import { formatValue } from '@/common/methods';
 import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
 import { getPriceTypeName } from '@/common/constants/enumsName';
 import { fundsReq } from '@/views/business/purchase/components/setup';
 import { handleForm } from './setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'sell_pending_funds',
     components: {},
+    emits: ['cancel'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3SellBuyContract>,
@@ -181,7 +184,7 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('sell_pending_funds');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleForm();
 
@@ -197,8 +200,7 @@ export default defineComponent({
                 }
                 // 发出发票登记
                 fundsReq(props.selectedRow.spotcontractid, params, loading, formState.Remark).then(() => {
-                    cancel();
-                    context.emit('refresh');
+                    cancel(true);
                 });
             });
         }

+ 12 - 9
src/views/business/sell/components/invoice/index.vue

@@ -52,17 +52,20 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="贷款总额">
-              <span class="white">{{ formatValue(selectedRow.loanamount) + selectedRow.currencyname }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.loanamount) + selectedRow.currencyname }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="保证金">
-              <span class="white">{{ formatValue(selectedRow.margin) + selectedRow.currencyname }}</span>
+              <span
+                    class="white">{{ formatValue(selectedRow.margin) + selectedRow.currencyname }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="其他费用">
-              <span class="white">{{ selectedRow.reckonotheramount + selectedRow.currencyname }}</span>
+              <span
+                    class="white">{{ selectedRow.reckonotheramount + selectedRow.currencyname }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -82,7 +85,8 @@
           </a-col>
           <a-col :span="24">
             <a-form-item label="预收票额">
-              <span class="white">{{ selectedRow.preinvoiceamount + selectedRow.currencyname }}</span>
+              <span
+                    class="white">{{ selectedRow.preinvoiceamount + selectedRow.currencyname }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -129,17 +133,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 { getPriceTypeName } from '@/common/constants/enumsName';
 import { formatValue } from '@/common/methods';
 import { handleForm } from '@/views/business/purchase/components/invoice/setup';
 import { InvoiceReq } from '@/services/proto/contract/interface';
 import { invoiceReq } from '@/views/business/purchase/components/setup';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'sell_pending_invoice',
-    components: {},
+    emits: ['cancel'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3SellBuyContract>,
@@ -147,7 +151,7 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('sell_pending_invoice');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleForm();
 
@@ -161,8 +165,7 @@ export default defineComponent({
                 // 发出发票登记
                 invoiceReq(props.selectedRow.spotcontractid, params, loading)
                     .then(() => {
-                        cancel();
-                        context.emit('refresh');
+                        cancel(true);
                     })
                     .catch((err) => {});
             });

+ 22 - 13
src/views/business/sell/components/settlement/index.vue

@@ -47,7 +47,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">
@@ -74,7 +75,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="调整金额">
-              <span class="white">{{ selectedRow.reckonadjustamount + selectedRow.currencyname }}</span>
+              <span
+                    class="white">{{ selectedRow.reckonadjustamount + selectedRow.currencyname }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -84,7 +86,8 @@
           </a-col>
           <a-col :span="24">
             <a-form-item label="其他费用">
-              <span class="white">{{ selectedRow.reckonotheramount + selectedRow.currencyname }}</span>
+              <span
+                    class="white">{{ selectedRow.reckonotheramount + selectedRow.currencyname }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -113,7 +116,8 @@
                                   style="width: 200px"
                                   placeholder="请输入交收量"
                                   suffix="单位" />
-                  <div class="tip mt10"><span>待交收量:{{selectedRow.unsureqty}}吨</span><a class="blue fr"
+                  <div class="tip mt10"><span>待交收量:{{selectedRow.unsureqty}}吨</span><a
+                       class="blue fr"
                        @click="formState.ReckonRealQty=selectedRow.unsureqty">全部登记</a></div>
                 </a-form-item>
                 <a-form-item class="relative"
@@ -123,7 +127,8 @@
                                   style="width: 200px"
                                   placeholder="请输入交收量"
                                   suffix="单位" />
-                  <div class="tip mt10"><span class="fl">未定价量:--吨</span><a class="blue fr">全部登记</a></div>
+                  <div class="tip mt10"><span class="fl">未定价量:--吨</span><a class="blue fr">全部登记</a>
+                  </div>
                 </a-form-item>
               </a-form-item>
             </a-col>
@@ -157,7 +162,8 @@
                 <template #label>
                   <a-checkbox value="调整保证金"
                               v-model:checked="checkedObj.margin"
-                              @change="()=>checkedObj.margin = !checkedObj.margin">调整保证金</a-checkbox>
+                              @change="()=>checkedObj.margin = !checkedObj.margin">调整保证金
+                  </a-checkbox>
                 </template>
                 <a-form-item class="relative"
                              v-if="checkedObj.margin">
@@ -220,7 +226,8 @@
                 <template #label>
                   <a-checkbox value="调整金额"
                               v-model:checked="checkedObj.justAmount"
-                              @change="()=>checkedObj.justAmount = !checkedObj.justAmount">调整金额</a-checkbox>
+                              @change="()=>checkedObj.justAmount = !checkedObj.justAmount">调整金额
+                  </a-checkbox>
                 </template>
                 <a-form-item class="relative"
                              v-if="checkedObj.justAmount">
@@ -229,11 +236,13 @@
                     <a-row style="width: 200px">
                       <a-col :span="12">
                         <a-radio :value="1"
-                                 @focus="()=>{formState.ReckonAdjustAmount  ?formState.ReckonAdjustAmount= Math.abs(formState.ReckonAdjustAmount):0}">增加</a-radio>
+                                 @focus="()=>{formState.ReckonAdjustAmount  ?formState.ReckonAdjustAmount= Math.abs(formState.ReckonAdjustAmount):0}">
+                          增加</a-radio>
                       </a-col>
                       <a-col :span="12">
                         <a-radio :value="2"
-                                 @focus="()=>{formState.ReckonAdjustAmount  ?formState.ReckonAdjustAmount= -1* Math.abs(formState.ReckonAdjustAmount):0}">减少</a-radio>
+                                 @focus="()=>{formState.ReckonAdjustAmount  ?formState.ReckonAdjustAmount= -1* Math.abs(formState.ReckonAdjustAmount):0}">
+                          减少</a-radio>
                       </a-col>
                     </a-row>
                   </a-radio-group>
@@ -298,17 +307,18 @@
 
 <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 { SettlementReq } from '@/services/proto/contract/interface';
 import { settlementReq } from '@/views/business/purchase/components/setup';
 import { handleForm } from '@/views/business/purchase/components/settlement/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_settlement',
     components: {},
+    emits: ['cancel'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3SellBuyContract>,
@@ -316,7 +326,7 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('sell_pending_settlement');
+        const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         const { rules, formState, formRef, checkedObj } = handleForm();
         function submit() {
@@ -362,8 +372,7 @@ export default defineComponent({
                 // 发出交收请求
                 settlementReq(props.selectedRow.spotcontractid, param, loading)
                     .then(() => {
-                        cancel();
-                        context.emit('refresh');
+                        cancel(true);
                     })
                     .catch((err) => {});
             });

+ 16 - 24
src/views/business/sell/components/storage/index.vue

@@ -136,8 +136,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, unref, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import { defineComponent, PropType, ref, unref } from 'vue';
 import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
 import { ERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interface';
 import { QueryAreaStockApply, QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
@@ -145,16 +144,16 @@ import * as Long from 'long';
 import { formatValue } from '@/common/methods';
 import { handleForm } from './setup';
 import APP from '@/services';
-import { initData } from '@/common/methods';
 import { ErmcpWareHouseInfo } from '@/views/information/warehouse-info/list';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { message } from 'ant-design-vue';
 import { Ermcp3AreaStockApplySum } from '@/services/go/ermcp/warehouse-info/interface';
 import { ermcpInOutStockApplyReq } from '@/services/proto/warehouse';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: 'sell_pending_storage',
-    components: {},
+    emits: ['cancel'],
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3SellBuyContract>,
@@ -162,30 +161,24 @@ export default defineComponent({
         },
     },
     setup(props, context) {
-        const { visible, cancel } = closeModal('sell_pending_storage');
+        const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef } = handleForm();
         const loading = ref<boolean>(false);
         const wareHouseList = ref<ErmcpWareHouseInfo[]>([]);
         const gblist = ref<[]>([]);
         const gmlist = ref<[]>([]);
         const DGList = ref<Ermcp3AreaStockApplySum[]>([]);
-        watchEffect(() => {
-            if (visible.value) {
-                QueryAreaStockApply(props.selectedRow.spotcontractid)
-                    .then((res) => {
-                        DGList.value = res.filter((e) => e.inouttype === 1);
-                    })
-                    .catch((err) => message.error(err));
-            }
-        });
-        initData(() => {
-            const deliverygoods = APP.get('DeliveryGoodsList').find((x: any) => x.deliverygoodsid === props.selectedRow.deliverygoodsid);
-            gblist.value = deliverygoods && deliverygoods.gblist;
-            gmlist.value = deliverygoods && deliverygoods.gmlist;
-            // 查询仓库信息
-            QueryWareHouse('1').then((res) => {
-                wareHouseList.value = res;
-            });
+        QueryAreaStockApply(props.selectedRow.spotcontractid)
+            .then((res) => {
+                DGList.value = res.filter((e) => e.inouttype === 1);
+            })
+            .catch((err) => message.error(err));
+        const deliverygoods = APP.get('DeliveryGoodsList').find((x: any) => x.deliverygoodsid === props.selectedRow.deliverygoodsid);
+        gblist.value = deliverygoods && deliverygoods.gblist;
+        gmlist.value = deliverygoods && deliverygoods.gmlist;
+        // 查询仓库信息
+        QueryWareHouse('1').then((res) => {
+            wareHouseList.value = res;
         });
 
         function submit() {
@@ -202,8 +195,7 @@ export default defineComponent({
                     ApplyRemark: '', // string 申请备注
                 };
                 requestResultLoadingAndInfo(ermcpInOutStockApplyReq, params, loading, ['出库登记成功', '出库登记失败:']).then(() => {
-                    context.emit('refresh');
-                    cancel();
+                    cancel(true);
                 });
             });
         }

+ 54 - 58
src/views/business/sell/list/performance/index.vue

@@ -3,82 +3,78 @@
   <div class="sell_performance"
        :loading="loading">
     <filterCustomTable @search="updateColumn">
-      <BtnList :btnList="commonBtn" />
+      <BtnList :btnList="firstBtn"
+               @click="openComponent" />
     </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               :pagination="false"
-               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" />
-    <!-- 交收登记 -->
-    <Settlement :selectedRow="selectedRow"
-                @refresh="queryTable" />
-    <!-- 款项登记 -->
-    <Funds :selectedRow="selectedRow"
-           @refresh="queryTable" />
-    <!-- 发票登记 -->
-    <Invoice :selectedRow="selectedRow"
-             @refresh="queryTable" />
-    <!-- 出库登记 -->
-    <Storage :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, Settlement, Funds, Invoice, Storage } 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 Settlement = defineAsyncComponent(() => import('../../components/settlement/index.vue')); //交收登记
+const Funds = defineAsyncComponent(() => import('../../components/funds/index.vue')); // 款项登记
+const Invoice = defineAsyncComponent(() => import('../../components/invoice/index.vue')); // 发票登记
+const Storage = defineAsyncComponent(() => import('../../components/storage/index.vue')); // 入库登记
 
 export default defineComponent({
     name: 'sell_performance',
     components: {
         contextMenu,
         filterCustomTable,
-        Detail,
-        Settlement,
-        Funds,
-        Invoice,
-        Storage,
         BtnList,
+        [ModalEnum.detail]: Detail,
+        [ModalEnum.sell_pending_settlement]: Settlement,
+        [ModalEnum.sell_pending_funds]: Funds,
+        [ModalEnum.sell_pending_invoice]: Invoice,
+        [ModalEnum.sell_pending_storage]: Storage,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3SellBuyContract>({});
-        // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('sell_performance', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(3);
-        initData(() => {
-            // 获取列表数据
-            queryTable();
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_sales_settle', ['accountname', 'contractno', 'deliverygoodsname', 'convertfactor', 'goodsname']);
-        });
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3SellBuyContract>();
+        // 获取列表数据
+        const queryTableAction = () => queryTable(QueryWareHouse, { querytype: 3 });
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: 'sell_performance',
+            tableName: 'table_pcweb_sales_settle',
+            tableFilterKey: ['accountname', 'contractno', 'deliverygoodsname', 'convertfactor', 'goodsname'],
+            isDetail: true,
+        };
         return {
-            columns,
-            expandedRowKeys,
-            selectedRow,
-            Rowclick,
-            commonBtn,
-            forDataBtn,
-            loading,
+            ...handleComposeTable<Ermcp3SellBuyContract>(param),
             tableList,
-            updateColumn,
+            loading,
         };
     },
 });