2 Commits bc1e797c55 ... 1878c765ca

Autor SHA1 Mensagem Data
  xiaodai2017 1878c765ca Merge branch 'v3.0' of http://120.46.155.214:3000/xiaodai2022/accout-vue3-ui into v3.0 há 11 meses atrás
  snow 0f7fa2fa38 feat:通用订单 há 1 ano atrás
43 ficheiros alterados com 2345 adições e 129 exclusões
  1. 7 6
      .env.development
  2. 1 1
      src/api/InvoiceSales/currentcyAssOrderRecord/index.ts
  3. 14 4
      src/api/InvoiceSales/currentcyOrderRecord/index.ts
  4. 5 0
      src/api/InvoiceSales/invoiceApply/index.ts
  5. 6 0
      src/api/purchase/orderRecord/index.ts
  6. 109 0
      src/components/ReconciliationForm/src/cpns/edit-modal.vue
  7. 103 16
      src/components/ReconciliationForm/src/cpns/purchase-table.vue
  8. 40 5
      src/components/ReconciliationForm/src/index.vue
  9. 1 0
      src/hooks/core/index.ts
  10. 1 1
      src/hooks/core/useAsync.ts
  11. 6 0
      src/utils/status.ts
  12. 23 13
      src/views/InvoiceSales/currentcyAssOrderRecord/config/content.config.ts
  13. 6 6
      src/views/InvoiceSales/currentcyAssOrderRecord/config/search.config.ts
  14. 167 0
      src/views/InvoiceSales/currentcyOrderRecord/components/order-form.vue
  15. 110 0
      src/views/InvoiceSales/currentcyOrderRecord/components/order-modal.vue
  16. 6 0
      src/views/InvoiceSales/currentcyOrderRecord/config/_options.ts
  17. 7 7
      src/views/InvoiceSales/currentcyOrderRecord/config/content.config.ts
  18. 7 7
      src/views/InvoiceSales/currentcyOrderRecord/config/search.config.ts
  19. 17 31
      src/views/InvoiceSales/currentcyOrderRecord/detail.vue
  20. 1 1
      src/views/InvoiceSales/currentcyOrderRecord/index.vue
  21. 4 7
      src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue
  22. 312 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/add-edit-form.vue
  23. 45 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/choose-form.vue
  24. 252 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/choose-modal.vue
  25. 63 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/_details.ts
  26. 12 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/_rules.ts
  27. 116 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/content.config.ts
  28. 41 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/search.config.ts
  29. 0 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/采购付款.md
  30. 281 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/columns.tsx
  31. 93 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/edit-order.vue
  32. 20 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/invoice-title.vue
  33. 74 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/order-dialog.vue
  34. 160 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/search-batch.vue
  35. 179 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/search-check.vue
  36. 32 0
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/search.config.ts
  37. 1 1
      src/views/InvoiceSales/invoiceApply/config/content.config.ts
  38. 12 1
      src/views/InvoiceSales/invoiceApply/detail.vue
  39. 9 17
      src/views/InvoiceSales/invoiceApply/index.vue
  40. 1 4
      src/views/dashboard/performanceReport/config/company.config.ts
  41. 1 1
      src/views/purchase/orderRecord/config/search.config.ts
  42. BIN
      src/views/purchase/purchPay/component/.choose-modal.vue.swo
  43. BIN
      src/views/purchase/purchPay/component/.choose-modal.vue.swp

+ 7 - 6
.env.development

@@ -16,18 +16,16 @@ VITE_APP_ID = "ww6076e6fd4268ee31"
 # 微信开发环境基础重定向url
 REDIRECT_BASE_URL = "http://cxinv.api.caixiao365.com"
 # 开发环境后端用户地址
-VITE_PROXY_USER_REAL1 = "http://user.api.caixiao365.com"
+VITE_PROXY_USER_REAL1 = "http://user.test241.wanyuhengtong.com"
 # 开发环境后端用户地址
-VITE_PROXY_USER_REAL = "http://cxinv.api.caixiao365.com"
+VITE_PROXY_USER_REAL = "http://stockinv.test241.wanyuhengtong.com"
 # 开发环境后端业务地址
-VITE_PROXY_DOMAIN_REAL = "http://cxinv.api.caixiao365.com"
+VITE_PROXY_DOMAIN_REAL = "http://stockinv.test241.wanyuhengtong.com"
 
 VITE_IS_PROD = true
 
-# 跳转采销地址
+# 跳转结算地址
 VITE_PURCHASE_URL = 'http://pin.caixiao365.com/'
-# 跳转工单地址
-VITE_GD_URL = 'http://bug.caixiao365.com/'
 
 # 报表地址
 VITE_DASHBOARD_URL = 'http://web.report.caixiao365.com/'
@@ -35,3 +33,6 @@ VITE_DASHBOARD_URL = 'http://web.report.caixiao365.com/'
 # token密钥
 VITE_SECRET_KEY = 'key123'
 
+
+# 跳转工单地址
+VITE_GD_URL = 'http://bug.caixiao365.com/'

+ 1 - 1
src/api/InvoiceSales/currentcyAssOrderRecord/index.ts

@@ -14,5 +14,5 @@ interface ResponseType extends Promise<any> {
 
 // 列表
 export const httpList = (data: any): ResponseType => {
-  return http.request('post', `${baseUrl}paylist`, { data })
+  return http.request('post', `${baseUrl}ComonOrder/list`, { data })
 }

+ 14 - 4
src/api/InvoiceSales/currentcyOrderRecord/index.ts

@@ -11,17 +11,27 @@ interface ResponseType extends Promise<any> {
   data?: any
 }
 
-//列表
+// 列表
 export const httpList = (data: any): ResponseType => {
-  return http.request('post', `${baseUrl}paylist`, { data })
+  return http.request('post', `${baseUrl}paylist`, {
+    data: {
+      ...data,
+      is_comon: '1'
+    }
+  })
 }
 
-//详情
+// 添加
+export const httpCreate = (data: any): ResponseType => {
+  return http.request('post', `${baseUrl}ComonOrder/payCreate`, { data })
+}
+
+// 详情
 export const httpDetail = (data: any): ResponseType => {
   return http.request('post', `${baseUrl}tradeloginfo`, { data })
 }
 
-//审核状态
+// 审核状态
 export const httpStatus = (data: any): ResponseType => {
   return http.request('post', `${baseUrl}orderpaystatus`, { data })
 }

+ 5 - 0
src/api/InvoiceSales/invoiceApply/index.ts

@@ -12,6 +12,11 @@ interface ResponseType extends Promise<any> {
 export const httpAdd = (data: object): ResponseType => {
   return http.request("post", `${yewuApi}orderinvadd`, { data });
 };
+
+
+export const httpCreate = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}ComonOrder/invAdd`, { data });
+};
 // 列表
 export const httpList = (data: object): ResponseType => {
   return http.request("post", `${yewuApi}orderinvlist`, { data });

+ 6 - 0
src/api/purchase/orderRecord/index.ts

@@ -13,6 +13,12 @@ export const httpDetail = (data: object): any => {
   return http.request("post", `${yewuApi}payinfo`, { data });
 };
 
+//通用对账单详情
+export const httpCommonDetail = (data: object): any => {
+  return http.request("post", `${yewuApi}ComonOrder/payInfo`, { data });
+};
+
+
 export const httpInfo = (data: object): any => {
   return http.request("post", `${yewuApi}payinfo`, { data });
 };

+ 109 - 0
src/components/ReconciliationForm/src/cpns/edit-modal.vue

@@ -0,0 +1,109 @@
+<script setup lang="tsx">
+import { shallowRef } from "vue";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+import { ElButton, ElDialog, ElForm, ElFormItem, ElInputNumber } from "element-plus";
+import { renderProp } from "/@/utils/columnRenderHelper";
+import { useRender } from "/@/hooks/core"
+import { ref } from "vue";
+import { cg_order_source_options, cg_order_type_options, sendStatusOptions, send_status_list } from "/@/utils/status";
+
+const visible = shallowRef(false);
+const descriptionData = ref<Record<string, any>>({});
+
+const emit = defineEmits(['save']);
+
+const columns = [
+  {
+    field: "sequenceNo",
+    label: "销售单编号",
+    span: 8
+  },
+  {
+    field: 'cxCode',
+    label: '销售单主编号',
+    span: 8
+  },
+  {
+    field: 'goodNo',
+    label: '商品编码',
+    span:8
+  },
+  {
+    field: 'totalPrice',
+    label: '总货款',
+  },
+
+  {
+    field: 'goodName',
+    label: '商品名称',
+    span: 12
+  },
+  {
+    field: 'goodPrice',
+    label: '商品单价'
+  },
+  {
+    field: 'goodNum',
+    label: '商品数量'
+  },
+  {
+    field: 'tax',
+    label: '税率'
+  },
+  {
+    field: 'ownerName',
+    label: '采购员'
+  },
+   {
+      label: '待开票金额',
+    field: 'winv_fee'
+  },
+  {
+    label: '开票金额',
+    render(_, row) {
+      return (
+        <ElInputNumber precision={2} v-model={descriptionData.value.inv_fee} min={0} />
+      )
+    }
+  },
+
+  {
+    label: '开票数量',
+    render(_, row) {
+     return (
+        <ElInputNumber v-model={descriptionData.value.num} min={0} />
+      )
+    }
+  }
+
+]
+
+function handleSave() { 
+  emit('save', descriptionData.value)
+  visible.value = false;
+}
+
+
+defineExpose({
+  onDisplay: (data: Record<string, any>) => { 
+    visible.value = true;
+    descriptionData.value = {
+      ...data,
+      num: data.num,
+      inv_fee: data.winv_fee
+    };
+  }
+})
+
+useRender(() => (
+  <ElDialog width="1024px" v-model={visible.value} title="编辑" center>
+    <BasicDescriptions data={descriptionData.value} columns={columns} />
+
+    <div class="flex justify-end w-full">
+      <ElButton type="primary" onClick={handleSave}>
+        保存
+      </ElButton>
+    </div>
+  </ElDialog>
+));
+</script>

+ 103 - 16
src/components/ReconciliationForm/src/cpns/purchase-table.vue

@@ -1,16 +1,21 @@
 <script setup lang="ts">
-import { ref, computed } from "vue";
+import { ref, computed, shallowRef} from "vue";
 import { ElMessage } from "element-plus";
 import PurchaseModal from "./purchase-modal.vue";
 
+import EditModal from "./edit-modal.vue"
+
 import {
   cg_order_type_options,
   cg_order_source_options,
   send_status_list,
   sendStatusOptions
 } from "/@/utils/status";
+import { Edit } from "vxe-table";
+
+const emit = defineEmits(["push", "delete", "choose", "edit", "openInv"]);
 
-const emit = defineEmits(["push", "delete", "choose"]);
+const selected = ref([]);
 
 const props = defineProps<{
   companyNo?: string;
@@ -18,10 +23,12 @@ const props = defineProps<{
   purchaseOrders: any;
   readonly: boolean;
   isPurchPay?: boolean;
+  edit?: boolean;
 }>();
 
 const PurchaseModalRef = ref<InstanceType<typeof PurchaseModal> | null>(null);
-
+const editModalRef = ref<InstanceType<typeof EditModal> | null>(null);
+const editIndex = shallowRef(-1);
 
 function addition(arg1, arg2) {
   var r1, r2, m;
@@ -53,6 +60,27 @@ const totalPrice = computed(() => {
   return Number(total).toFixed(2);
 });
 
+const onEdit = (index) => { 
+  editIndex.value = index;
+  editModalRef.value?.onDisplay(props.purchaseOrders[index]);
+}
+
+const onSave = (item) => { 
+  emit('edit', item,editIndex.value);
+  editIndex.value = -1;
+}
+
+const onOpenInv = () => { 
+  if (selected.value.length === 0) { 
+    ElMessage.warning("请选择至少一条采购单")
+    return;
+  }
+
+  emit('openInv', selected.value.map(({
+    num, inv_fee, sequenceNo }) => ({
+    num, inv_fee, sequenceNo })));
+}
+
 function handleAddPurchase() {
   const { supplierNo, companyNo } = props;
   if (!supplierNo || !companyNo) {
@@ -66,15 +94,24 @@ function handleAddPurchase() {
   <div>
     <div flex justify-between w-full mb-1>
       <ElTag type="warning"
+        v-if="!edit"
         >共计:{{ total }}个订单,共计 {{ totalPrice }} 元</ElTag
       >
 
+      <ElButton 
+        v-if="purchaseOrders.length !== 0 && edit" 
+        type="primary"
+        size="small"
+        @click="onOpenInv"
+        >开票申请
+      </ElButton>
+
       <ElButton
         v-if="!readonly && !isPurchPay"
         type="primary"
         @click="handleAddPurchase"
-        >添加采购单</ElButton
-      >
+        >添加采购单
+      </ElButton>
     </div>
 
     <ElTable
@@ -83,8 +120,12 @@ function handleAddPurchase() {
       size="small"
       :data="purchaseOrders"
       max-height="400"
+      @selection-change="val => selected = val"
     >
+      <ElTableColumn fixed="left" type="selection" />
+
       <ElTableColumn
+        v-if="!edit"
         label="采购单编码"
         show-overflow-tooltip
         prop="sequenceNo"
@@ -93,17 +134,18 @@ function handleAddPurchase() {
       <ElTableColumn
         label="销售订单编码"
         show-overflow-tooltip
-        prop="qrdCode"
+        :prop="edit ? 'sequenceNo' : 'qrdCode'"
         width="150"
       />
       <ElTableColumn
-        label="采购主单号"
+        :label="edit ? '销售主单号' : '采购主单号'"
         show-overflow-tooltip
         prop="cxCode"
         width="150"
       />
-      <ElTableColumn label="采购单信息">
+      <ElTableColumn label="采购单信息" v-if="!edit">
         <ElTableColumn
+          v-if="!edit"
           label="供货商"
           prop="supplierName"
           min-width="160"
@@ -117,6 +159,7 @@ function handleAddPurchase() {
           show-overflow-tooltip
         />
         <ElTableColumn
+          v-if="!edit"
           label="销售单发货状态"
           prop="qrdSend"
           width="110"
@@ -143,12 +186,14 @@ function handleAddPurchase() {
           </template>
         </ElTableColumn>
         <ElTableColumn
+          v-if="!Edit"
           label="业务公司"
           prop="companyName"
           min-width="180"
           show-overflow-tooltip
         />
         <ElTableColumn
+          v-if="!Edit"
           label="订单来源"
           prop="cgdSource"
           width="100"
@@ -169,6 +214,12 @@ function handleAddPurchase() {
           width="80"
           show-overflow-tooltip
         />
+        <ElTableColumn
+          label="开票金额"
+          prop="inv_fee"
+          width="80"
+          show-overflow-tooltip
+        />
       </ElTableColumn>
       <ElTableColumn label="商品信息">
         <ElTableColumn
@@ -189,6 +240,7 @@ function handleAddPurchase() {
           show-overflow-tooltip
         />
         <ElTableColumn
+          v-if="!Edit"
           label="商品来源"
           prop="cgdType"
           width="90"
@@ -203,16 +255,13 @@ function handleAddPurchase() {
             </ElTag>
           </template>
         </ElTableColumn>
+
         <ElTableColumn
           label="商品数量"
           prop="goodNum"
           width="90"
           show-overflow-tooltip
         />
-        <ElTableColumn label="税率" prop="tax" show-overflow-tooltip>
-          <template #="{ row }"> {{ row.tax }}% </template>
-        </ElTableColumn>
-      </ElTableColumn>
       <ElTableColumn
         label="采购员"
         prop="ownerName"
@@ -220,11 +269,44 @@ function handleAddPurchase() {
         show-overflow-tooltip
       />
 
-      <ElTableColumn label="操作" v-if="!readonly" fixed="right">
+      <ElTableColumn label="税率" prop="tax" show-overflow-tooltip>
+          <template #="{ row }"> {{ row.tax }}% </template>
+        </ElTableColumn>
+      </ElTableColumn>
+
+
+        <ElTableColumn
+          label="待开票金额"
+          prop="winv_fee"
+          width="90"
+          show-overflow-tooltip
+        />
+
+        <ElTableColumn
+          label="开票金额"
+          prop="inv_fee"
+          width="80"
+          show-overflow-tooltip
+        />
+
+       <ElTableColumn
+          label="开票数量"
+          prop="num"
+          width="90"
+          show-overflow-tooltip
+        />
+
+      <ElTableColumn label="操作" v-if="!readonly && !edit" fixed="right">
         <template #default="{ $index }">
-          <ElButton link type="primary" @click="() => emit('delete', $index)"
-            >删除</ElButton
-          >
+          <ElButton link type="primary" @click="() => emit('delete', $index)">
+            删除
+          </ElButton>
+        </template>
+      </ElTableColumn>
+
+      <ElTableColumn label="操作" v-if="edit" fixed="right">
+        <template #default="{ $index }">
+          <ElButton link type="primary" @click="onEdit($index)">编辑</ElButton>
         </template>
       </ElTableColumn>
     </ElTable>
@@ -235,5 +317,10 @@ function handleAddPurchase() {
       :supplierNo="supplierNo"
       @pushOrder="orders => emit('push', orders)"
     />
+
+    <EditModal
+      ref="editModalRef"
+      @save="onSave"
+    />
   </div>
 </template>

+ 40 - 5
src/components/ReconciliationForm/src/index.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import { ref, unref, watch, h } from "vue";
-import { httpDetail } from "/@/api/purchase/orderRecord";
+import { httpDetail, httpCommonDetail } from "/@/api/purchase/orderRecord";
 import PurchaseDescriptions from "./cpns/purchase-descriptions.vue";
 import RemoteSelect from "/@/components/RemoteSelect";
 import PurchaseTable from "./cpns/purchase-table.vue";
@@ -11,7 +11,7 @@ import { httpGetSupplier, httpGetBusiness } from "/@/api/user";
 
 import { useCompany } from "/@/hooks/core/useCompany";
 
-const emit = defineEmits(["create", "choose", "getRecord"]);
+const emit = defineEmits(["create", "choose", "getRecord", "openInv", "clear"]);
 
 const { currentCompany } = useCompany();
 
@@ -22,6 +22,9 @@ const props = defineProps<{
   readonly?: boolean;
   isPurchPay?: boolean;
   showTicketColumn?: boolean;
+  edit: boolean;
+  cover?: boolean;
+  platformType?: string
 }>();
 
 const formData = ref({
@@ -41,8 +44,19 @@ const {
 } = useAsync<Record<string, any>>({
   initalData: {},
   success: function (data) {
-     emit("getRecord", data)
-    uniquePurchaseOrders(data.cgdlist);
+
+    if (props.cover) { 
+      purchaseOrders.value = [];
+      formData.value.cids = [];
+    }
+
+    emit("getRecord", data)
+
+    uniquePurchaseOrders(data[props.edit ? 'qrdlist' : 'cgdlist'].map((item) => ({
+      ...item,
+      num: item.goodNum,
+      inv_fee:item.winv_fee
+    })));
   }
 });
 
@@ -76,7 +90,7 @@ async function handleCreate() {
   }
 }
 
-const requestDetail = () => run(httpDetail({ payNo: props.id }));
+const requestDetail = () => run(props.edit ? httpCommonDetail({ payNo: props.id }) : httpDetail({payNo:props.id}));
 
 const getLabel = company => {
   const { code, name, type } = company;
@@ -94,6 +108,14 @@ function handleGetRecord(records: Array<Record<any, any>>) {
   emit("getRecord", records)
 }
 
+const handleEditPurchaseOrders = (item, index) => { 
+  purchaseOrders.value[index] = { ...item };
+}
+
+function handlePushOrder(orderArr ) {
+  emit("openInv", { orderArr, payNo:props.id })
+}
+
 watch(
   () => props.id,
   value => value && requestDetail(),
@@ -108,6 +130,13 @@ watch(
   { immediate: true }
 );
 
+watch(() => props.platformType, () => { 
+  data.value = {};
+  purchaseOrders.value = [];
+  formData.value.cids = [];
+  emit("clear")
+})
+
 defineExpose({
   detail: data,
   refresh: () => requestDetail()
@@ -191,9 +220,12 @@ defineExpose({
           class="w-full mt-1"
           v-bind="formData"
           :readonly="readonly"
+          :edit="edit"
           :purchaseOrders="purchaseOrders"
           @delete="handleDeletePurchaseOrders"
           @push="uniquePurchaseOrders"
+          @edit="handleEditPurchaseOrders"
+          @openInv="handlePushOrder"
         />
       </ElFormItem>
 
@@ -210,11 +242,14 @@ defineExpose({
       v-if="isPurchPay"
       class="w-full mt-1"
       v-bind="formData"
+      :edit="edit"
       :readonly="readonly"
       :isPurchPay="isPurchPay"
       :purchaseOrders="purchaseOrders"
       @delete="handleDeletePurchaseOrders"
       @push="uniquePurchaseOrders"
+      @edit="handleEditPurchaseOrders"
+      @openInv="handlePushOrder"
     />
   </div>
 </template>

+ 1 - 0
src/hooks/core/index.ts

@@ -1 +1,2 @@
 export { useRender } from "./useRender"
+export { useAsync } from "./useAsync"

+ 1 - 1
src/hooks/core/useAsync.ts

@@ -65,7 +65,7 @@ export function useAsync<D = any>({
         handler: () => {
           setData(isList ? (data as any).list : data);
           isError.value = false;
-          if (pagination) pagination.total = (data as any).count;
+          if (pagination) pagination.total = (data as any)?.count;
           success && success(unref(data));
         }
       });

+ 6 - 0
src/utils/status.ts

@@ -156,6 +156,12 @@ export const cgdStatusOptions = [
   { value: "1", label: "已对账" }
 ];
 
+export const tyStatusOptions = [
+  { value: "0", label: "未对账" },
+  { value: "1", label: "对账中" },
+  { value: "1", label: "已对账" }
+];
+
 const pay_status_list = [
   { value: "1", label: "未认款", type: "warning" },
   { value: "2", label: "部分认款", type: "primary" },

+ 23 - 13
src/views/InvoiceSales/currentcyAssOrderRecord/config/content.config.ts

@@ -1,6 +1,10 @@
+import { h } from "vue"
 import { ContentConfig } from "/@/components/PageContent";
-import { httpList } from "/@/api/InvoiceSales/capitalPool";
+import { httpList } from "/@/api/InvoiceSales/currentcyAssOrderRecord";
 import { renderIconLabelLeft } from "/@/utils/columnRenderHelper";
+import { tyStatusOptions } from "/@/utils/status";
+import { ElTag } from "element-plus";
+
 
 const columns = [
   {
@@ -11,7 +15,7 @@ const columns = [
   },
   {
     label: '销售主单号',
-    prop: 'orderCode',
+    prop: 'cxCode',
     width: "150px"
   },
   {
@@ -29,33 +33,39 @@ const columns = [
     label: '买入方公司',
     prop: 'companyName',
     minWidth: 175,
-    ...renderIconLabelLeft('companyNo', 'companyName', '买入方公司编码:')
+    ...renderIconLabelLeft('customerNo', 'customerName', '买入方公司编码:')
   },
   {
     label: '下单数量',
     prop: 'num',
-    width: 80
+    width: 80,
+    cellRenderer({ row }) {
+      return row.qrd?.goodNum || '--';
+    }
   },
   {
     label: '销售单价',
     prop: 'num',
-    width: 80
+    width: 80,
+    cellRenderer({ row }) {
+      return row.qrd?.goodPrice || '--';
+    }
   },
   {
     label: '对账状态',
     prop: 'status',
-    width: 80
-  },
-  // {
-  //   label: "操作",
-  //   fixed: "right",
-  //   width: 60, //后期修改
-  //   slot: "operation"
-  // }
+    width: 80,
+    cellRenderer({ row }) {
+      return h(ElTag, null, {
+        default: () => tyStatusOptions.find(c => c.value == row.status)?.label || '--'
+      });
+    }
+  }
 ];
 
 const contentConfig: ContentConfig = {
   title: "通用订单关联订单已回款列表",
+  companyProp: 'customerNo',
   columns,
   apis: {
     httpList

+ 6 - 6
src/views/InvoiceSales/currentcyAssOrderRecord/config/search.config.ts

@@ -18,13 +18,13 @@ const searchFormConfig: FormConfig = {
     {
       field: "orderCode",
       placeholder: "销售订单编号",
-      type: "select"
-    },
-    {
-      field: "companyNo",
-      placeholder: "买入方公司",
-      type: "business-query"
+      type: "input"
     },
+    // {
+    //   field: "companyNo",
+    //   placeholder: "买入方公司",
+    //   type: "business-query"
+    // },
     {
       field: "supplierNo",
       placeholder: "卖出方公司",

+ 167 - 0
src/views/InvoiceSales/currentcyOrderRecord/components/order-form.vue

@@ -0,0 +1,167 @@
+<script setup lang="tsx">
+import { ref,shallowReactive, onMounted, watch, shallowRef } from "vue";
+import { useRender, useAsync } from "/@/hooks/core"
+import OrderModal from "./order-modal.vue"
+import { ElForm, ElFormItem, ElButton, ElTable, ElTableColumn, ElMessage, ElTag, ElRow, ElCol, ElInput } from "element-plus"
+import { httpCreate } from "/@/api/InvoiceSales/currentcyOrderRecord";
+import { tyStatusOptions } from "/@/utils/status";
+import RemoteSelect from "/@/components/RemoteSelect";
+import { httpGetBusiness, httpGetSupplier } from "/@/api/user";
+import { useCompany } from "/@/hooks/core/useCompany";
+import { orderFormRules } from "../config/_options"
+
+const emit = defineEmits(["create"]);
+const formRef = ref<InstanceType<typeof ElForm> | null>(null);
+const orderModalRef = ref<InstanceType<typeof OrderModal> | null>(null);
+const platform_type = shallowRef("");
+const list = ref<Record<string, any>[]>([]);
+const { currentCompany } = useCompany();
+
+const formData = shallowReactive({
+  customerNo: "",
+  companyNo: "",
+})
+
+const { run, loading } = useAsync({
+  success:() => emit('create')
+});
+
+function handleList(val: Record<string, any>[]) {
+  const sourceIds = list.value.map((item) => String(item.id));
+  const uniqueList = val.filter(({ id }) => !sourceIds.includes(String(id)));
+  list.value = [...list.value, ...uniqueList];
+}
+
+async function handleCreate() { 
+  try {
+    await formRef.value?.validate();
+    if (list.value.length === 0) return ElMessage.warning('请选择通用订单');
+    run(httpCreate({ common_ids: list.value.map(item => item.id) }))
+  } catch (err) { 
+    console.log(err)
+  }
+}
+
+const getBusinessLabel = company => {
+  const { companyNo, company_name } = company;
+  return companyNo + " / " + company_name;
+};
+
+const getLabel = company => {
+  const { code, name, type } = company;
+  const isCompany = type === "3" || type === "业务公司";
+  const suffix = isCompany ? "(已升级为业务公司)" : "";
+  return code + " / " + name + suffix;
+};
+
+
+const handleShowModal = () => { 
+  const { companyNo, customerNo} = formData;
+
+  if (!companyNo) { 
+    ElMessage.warning("请选择卖出方公司");
+    return
+  }
+
+  orderModalRef.value?.onDisplay(customerNo, companyNo);
+}
+
+onMounted(() => formData.customerNo = currentCompany.value.companyNo);
+watch(() => [formData.customerNo, formData.customerNo], () => list.value = []);
+watch(() => platform_type.value, () => list.value = []);
+useRender(() => (
+  <>
+    <ElForm rules={orderFormRules} ref={formRef} model={formData}>
+      <ElRow gutter={10}>
+        <ElCol span={12}>
+          <ElFormItem label="买入方公司" prop="customerNo">
+            <ElInput v-model={currentCompany.value.companyName} disabled></ElInput>
+          </ElFormItem>
+        </ElCol>
+
+        <ElCol span={12}>
+          <ElFormItem label="卖出方公司" prop="companyNo">
+            <RemoteSelect
+               style="width: 100%"
+               api={httpGetSupplier}
+               requestProp="name"
+               responseLabel-prop="name"
+               responseValProp="code"
+               placeholder="请选择卖方公司"
+               v-model:value={formData.companyNo}
+               getLabel={getLabel}
+              />
+           </ElFormItem>
+        </ElCol>
+      </ElRow>
+
+      <ElFormItem class="be-current__item" v-slots={{
+        label: () => (
+            <div class="w-full flex justify-between">
+              <div>
+                <span style="color:red;margin-right:5px">*</span>
+                <span>通用订单</span>
+            </div>
+              
+            <div>
+                平台类型:
+              <el-switch
+                  style="margin-right:10px"
+                  v-model={platform_type.value}
+                  size="small"
+                  active-text="toC"
+                  inactive-text="toB"
+                  active-value="2"
+                  inactive-value="1"
+                />
+
+                <ElButton type="primary" size="small" onClick={handleShowModal}>添加通用订单</ElButton>
+              </div>
+            </div>
+        )
+      }}>
+            <ElTable border size="small" data={list.value} class="mt-[10px]">
+              <ElTableColumn label="确认单编号" min-width="160" prop="orderCode" show-overflow-tooltip />
+              <ElTableColumn label="销售订单主编号" min-width="160" prop="cxCode" show-overflow-tooltip />
+              <ElTableColumn label="申请人" prop="apply_name" width="100px" show-overflow-tooltip />
+              <ElTableColumn label="买入方公司" min-width="160" prop="customerName" show-overflow-tooltip />
+              <ElTableColumn label="卖出方公司" min-width="160" prop="companyName" show-overflow-tooltip />
+              <ElTableColumn label="下单数量" width="80" prop="goodNum" show-overflow-tooltip v-slots={{
+                default: (scope) => scope.row.qrd ? scope.row.qrd.goodNum :""
+               }} />
+              <ElTableColumn label="销售单价" width="80" prop="goodPrice" show-overflow-tooltip v-slots={{
+                 default: (scope) => scope.row.qrd ? scope.row.qrd.goodPrice :""
+              }} />
+              <ElTableColumn label="对账状态" width="80" prop="status" show-overflow-tooltip v-slots={{
+                default: (scope) => <ElTag>{ tyStatusOptions.find(c => c.value == scope.row.status)?.label || '--' }</ElTag>
+              }} />
+              <ElTableColumn label="下单时间" width="100" prop="addtime" show-overflow-tooltip />
+
+              <ElTableColumn label="操作" fixed="right" width="60px" v-slots={{
+                default:(scope) => <ElButton size="small" type="primary" text onClick={() => list.value.splice(scope.$index)}>删除</ElButton>
+              }} />
+                
+            </ElTable>
+        </ElFormItem>
+
+      <div class="w-full flex justify-end">
+        <ElButton type="primary" onClick={handleCreate}>保存</ElButton>
+      </div>
+    </ElForm>
+
+
+    <OrderModal platform_type={platform_type.value} ref={orderModalRef} onList={handleList} />
+  </>
+))
+</script>
+
+
+<style scoped lang="scss">
+.be-current__item {
+  display: block;
+
+  ::v-deep(.el-form-item__label) {
+    display: block;
+  }
+}
+</style>

+ 110 - 0
src/views/InvoiceSales/currentcyOrderRecord/components/order-modal.vue

@@ -0,0 +1,110 @@
+<script setup lang="tsx">
+import { shallowRef, onMounted, ref } from "vue"
+import { useRender, useAsync } from "/@/hooks/core"
+import { httpList } from "/@/api/InvoiceSales/currentcyAssOrderRecord";
+import { tyStatusOptions } from "/@/utils/status";
+
+
+import { ElDialog, ElTable, ElTableColumn, ElMessage, ElButton, ElPagination, ElTag, ElRow, ElCol,ElSelect,ElOption } from "element-plus"
+
+
+const visible = shallowRef(false);
+
+const emit = defineEmits(['list']);
+
+const tableRef = ref<InstanceType<typeof ElTable> | null>(null);
+const { run, loading, data } = useAsync({
+  isList: true,
+  success:(data) => params.value.total = data.count
+});
+
+const props = defineProps<{
+  platform_type: string
+}>();
+
+const initialParams = {
+  size: 15,
+  total: 0,
+  page: 1,
+
+  companyNo: "",
+  customerNo: "",
+
+  status: "0"
+}
+
+const list = ref<any[]>([]);
+const params = ref({ ...initialParams });
+const requestList = () => run(httpList({
+  ...params.value,
+  platform_type: props.platform_type
+}));
+
+function handleList() {
+  if (list.value.length === 0) { 
+    ElMessage.warning("请选择通用订单");
+    return;
+  }
+  
+  emit('list', list.value)
+  visible.value = false;
+  tableRef.value?.clearSelection();
+}
+
+defineExpose({
+  onDisplay: (customerNo: string, companyNo: string) => { 
+    visible.value = true;
+    params.value = { ...initialParams, companyNo, customerNo };
+    requestList();
+  }
+})
+
+useRender(() => { 
+  return (
+    <ElDialog v-model={visible.value} title="通用订单列表" center width="1024px">
+      <ElRow class="mb-[10px]">
+        <ElCol span={8}>
+          <ElSelect v-model={params.value.status} size="small" disabled>
+            {
+              tyStatusOptions.map(({ value, label}) => { 
+                return <ElOption label={label} value={value}></ElOption>
+              })
+             }
+          </ElSelect>
+        </ElCol>
+      </ElRow>
+
+      <ElTable border size="small" ref={tableRef} data={data.value} v-loading={loading.value} onSelectionChange={val => list.value = val}>
+        <ElTableColumn type="selection" />
+        <ElTableColumn label="确认单编号" min-width="160" prop="orderCode" show-overflow-tooltip />
+        <ElTableColumn label="销售订单主编号" min-width="160" prop="cxCode" show-overflow-tooltip />
+        <ElTableColumn label="申请人" prop="apply_name" width="100px" show-overflow-tooltip />
+        <ElTableColumn label="买入方公司" min-width="160" prop="customerNo" show-overflow-tooltip />
+        <ElTableColumn label="卖出方公司" min-width="160" prop="companyName" show-overflow-tooltip />
+        <ElTableColumn label="下单数量" width="80" prop="goodNum" show-overflow-tooltip v-slots={{
+          default: (scope) => scope.row.qrd ? scope.row.qrd.goodNum :""
+        }} />
+        <ElTableColumn label="销售单价" width="80" prop="goodPrice" show-overflow-tooltip v-slots={{
+           default: (scope) => scope.row.qrd ? scope.row.qrd.goodPrice :""
+        }} />
+        <ElTableColumn label="对账状态" width="80" prop="status" show-overflow-tooltip v-slots={{
+          default: (scope) => <ElTag>{ tyStatusOptions.find(c => c.value == scope.row.status)?.label || '--' }</ElTag>
+        }} />
+        <ElTableColumn label="下单时间" width="100" prop="addtime" show-overflow-tooltip />
+      </ElTable>
+
+      <div class="flex justify-between w-full mt-[10px]">
+        <ElPagination 
+          v-model:currentPage={params.value.page}
+          v-model:pageSize={params.value.size}
+          layout="total,prev, pager, next, jumper"
+          total={params.value.total}
+          background={true}
+          small={true}
+        />
+        <ElButton type="primary" size="small" onClick={handleList}>添加</ElButton>
+      </div>
+    </ElDialog>
+  )
+})
+</script>

+ 6 - 0
src/views/InvoiceSales/currentcyOrderRecord/config/_options.ts

@@ -4,3 +4,9 @@ export const statusOptions = [
   { value: '3', label: '买方驳回' },
   { value: '4', label: '已撤销对账' }
 ];
+
+
+export const orderFormRules = {
+  customerNo: [{ required: true, message: '请选择买方公司编码', trigger: 'blur' }],
+  companyNo: [{ required: true, message: '请选择买方公司编码', trigger: 'blur' }]
+}

+ 7 - 7
src/views/InvoiceSales/currentcyOrderRecord/config/content.config.ts

@@ -16,7 +16,7 @@ const columns = [
   },
   {
     label: '对账单总金额',
-    prop: 'dzTotalAmount',
+    prop: 'total_fee',
     width: '100px'
   },
   {
@@ -38,16 +38,16 @@ const columns = [
     ...renderProp(hasAccountOptions, "has_account")
   },
   {
-    label: '卖出方公司',
-    prop: 'supplierName',
+    label: '买入方公司',
+    prop: 'companyName',
     minWidth: 175,
-    ...renderIconLabelLeft('supplierNo', 'supplierName', '卖出方公司编码:')
+    ...renderIconLabelLeft('companyNo', 'companyName', '买入方公司:')
   },
   {
-    label: '买入方公司',
-    prop: 'companyName',
+    label: '卖出方公司',
+    prop: 'supplierName',
     minWidth: 175,
-    ...renderIconLabelLeft('companyNo', 'companyName', '买入方公司编码:')
+    ...renderIconLabelLeft('supplierNo', 'supplierName', '卖出方公司编码:')
   },
   {
     label: '创建人',

+ 7 - 7
src/views/InvoiceSales/currentcyOrderRecord/config/search.config.ts

@@ -20,27 +20,27 @@ const searchFormConfig: FormConfig = {
       field: 'supplierNo',
       type: 'supplier-query'
     },
-    {
-      field: 'companyNo',
-      type: 'business-query'
-    },
+    // {
+    //   field: 'companyNo',
+    //   type: 'business-query'
+    // },
     {
       field: 'payNo',
       type: 'input',
       placeholder: '对账编号'
     },
     {
-      field: 'tag_status',
+      span: 4,
+      field: 'tag_id',
       type: 'select',
-      span: '4',
       placeholder: '标签状态',
       options: tagTypeOptions
     },
     {
+      span: 4,
       field: 'status',
       type: 'select',
       placeholder: '状态',
-      span: '4',
       options: statusOptions
     }
   ]

+ 17 - 31
src/views/InvoiceSales/currentcyOrderRecord/detail.vue

@@ -1,57 +1,43 @@
 <script setup lang="tsx">
-import {  shallowRef } from 'vue'
+import { shallowRef } from 'vue'
+import { useRouter } from "vue-router"
 import { useDetail } from "/@/hooks/core/useDetail";
 import { usePermission } from "/@/hooks/core/usePermission";
 import ReconciliationForm from "/@/components/ReconciliationForm";
-import { DefaultApprovalNode } from "/@/components/ApprovalNode";
 import { useRender } from '/@/hooks/core/useRender';
 import { ElTabs, ElTabPane, ElCollapse, ElCollapseItem } from "element-plus"
+import OrderForm from "./components/order-form.vue"
 
 const pageName = "currentcyOrderRecordDetail"
 
 const { id, title, isDetail, collapses } = useDetail({
-  baseName: '订单对账',
+  baseName: '通用订单对账',
   collapseLen:2
 });
 
+const { push } = useRouter();
 const { hasPermissionWithCode } = usePermission(pageName);
 const loading = shallowRef(false);
 
-function onCreate() { 
-
-}
-
-function onApproval() { 
-  console.log(collapses.value)
-}
-//  ref={formRef} 
-
 useRender(() => (
   <div class="padding__container">
     <ElTabs>
       <ElTabPane label={title.value}>
         <ElCollapse v-model={collapses.value}>
           <ElCollapseItem title={title.value} name="1">
-            <ReconciliationForm
-              id={id.value}
-              loading={loading.value}
-              readonly={isDetail.value}
-              onCreate={onCreate}
-              isPurch
-            />
+            { 
+              isDetail.value 
+                ? (<ReconciliationForm
+                    id={id.value}
+                    loading={loading.value}
+                    readonly={isDetail.value}
+                    isPurch
+                  />)
+                : (
+                  <OrderForm onCreate={() => push('/InvoiceSales/currentcyOrderRecord')} />
+                )
+            }
           </ElCollapseItem>
-
-          { 
-            isDetail.value && hasPermissionWithCode('039') && (
-              <ElCollapseItem title='买入方公司审核' name="2">
-                <DefaultApprovalNode
-                  approveValue='2'
-                  rejectValue='3'
-                  onApproval={onApproval}
-                />
-              </ElCollapseItem>
-            )
-          }
         </ElCollapse>
       </ElTabPane>
     </ElTabs>

+ 1 - 1
src/views/InvoiceSales/currentcyOrderRecord/index.vue

@@ -33,7 +33,7 @@ useRender(() => {
         v-slots={{
           content_header: () => (
             hasPermissionWithCode('002') && (
-              <ElButton type="primary" onClick={() => push(baseDetailPath)}>
+              <ElButton size="small" type="primary" onClick={() => push('/InvoiceSales/currentcyOrderRecordDetail')}>
                 添加
               </ElButton>
             )

+ 4 - 7
src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue

@@ -258,7 +258,6 @@ onMounted(() => {
       v-loading="loading"
       :model="ruleForm"
       :rules="rules"
-      label-width="100px"
       status-icon
       size="small"
     >
@@ -267,7 +266,6 @@ onMounted(() => {
           <el-form-item
             label="销售方公司抬头"
             prop="companyNo"
-            label-width="135px"
           >
             <el-select
               style="width: 100%"
@@ -290,7 +288,6 @@ onMounted(() => {
           <el-form-item
             label="购买方公司抬头"
             prop="buy_id"
-            label-width="135px"
           >
             <RemoteSelect
               is-root
@@ -306,8 +303,9 @@ onMounted(() => {
           </el-form-item>
           <InvoiceTitle :detail="purchaserInvoiceTitle" />
         </el-col>
+        
         <el-col :span="6">
-          <el-form-item label-width="100px" label="发票类型" prop="invtype">
+          <el-form-item label="发票类型" prop="invtype">
             <el-select
               v-model="ruleForm.invtype"
               style="width: 100%"
@@ -323,12 +321,11 @@ onMounted(() => {
               />
             </el-select>
           </el-form-item>
-          <el-form-item label-width="100px" label="电子邮箱" prop="email">
+          <el-form-item label="电子邮箱" prop="email">
             <el-input v-model="ruleForm.email" placeholder="电子邮箱" />
           </el-form-item>
 
           <el-form-item
-            label-width="100px"
             label="平台类型"
             prop="platform_type"
           >
@@ -356,7 +353,7 @@ onMounted(() => {
         </el-col>
 
         <el-col :span="18">
-          <el-form-item label="申请备注" prop="exam_remark" label-width="135px">
+          <el-form-item label="申请备注" prop="exam_remark">
             <el-input
               w-full
               v-model="ruleForm.exam_remark"

+ 312 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/add-edit-form.vue

@@ -0,0 +1,312 @@
+<script setup lang="ts">
+import { reactive, ref, watch, nextTick, onMounted } from "vue";
+import { FormRules, ElForm, ElMessage } from "element-plus";
+import { httpAdd , httpCreate} from "/@/api/InvoiceSales/invoiceApply";
+import RemoteSelect from "/@/components/RemoteSelect";
+import { httpInvoiceList } from "/@/api/InvoiceSales/invoiceApply";
+import { httpList as httpCompanylist } from "/@/api/parameter/finance";
+import OrderDialog from "./order-dialog.vue";
+import EditOrder from "./edit-order.vue";
+import { useResponseHandle } from "/@/hooks";
+import { useRouter } from "vue-router";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import InvoiceTitle from "./invoice-title.vue";
+import { convertInvoiceTitle, convertInvoiceTitleData } from "./columns";
+import { useCompany } from "/@/hooks/core/useCompany";
+import ChooseForm from "./chooseForm/choose-form.vue";
+
+import { ADD_EDIT_FORM_RULES } from "./../../config/configs";
+import { xs_inv_type_list, useTypeOptions } from "/@/utils/status";
+
+const formRef = ref<InstanceType<typeof ElForm> | null>(null)
+enum FROM_TYPE {
+  order = "order",
+  invoice = "invoice"
+}
+
+const TYPE = ref<FROM_TYPE>(FROM_TYPE.order);
+
+const { companyList } = useCompany();
+const { push } = useRouter();
+
+
+const modelRef = ref<InstanceType<typeof OrderDialog>>(null);
+const editOrderRef = ref<InstanceType<typeof EditOrder>>(null);
+const responseHandle = useResponseHandle();
+const loading = ref(false);
+
+const { currentCompany } = useCompany();
+
+//最大开票金额
+const denomination = ref(0);
+
+const max = 150;
+
+const initform = {
+  companyNo: "", //销售方公司抬头
+  invtype: "", //开票类型
+  email: "", //邮箱
+  remark: "", //发票备注
+  exam_remark: "", //申请备注
+  orderArr: [], //开票销售订单明细 obj:sequenceNo//销售订单编码 inv_fee//销售订单开票金额,
+  companyType: "01",
+  platform_type: "",
+  buyer:""
+};
+
+const ruleForm = ref({ ...initform });
+const invoiceTypes = ref([]);
+const rules = reactive<FormRules>({ ...ADD_EDIT_FORM_RULES });
+
+function handleShowEditModal(_, row: any) {
+  editOrderRef.value.onDisplay({
+    row
+  });
+}
+
+function menu_type_change() {
+  const { invtype } = ruleForm.value;
+  rules.email[0].required =
+    invtype === "special_electronic" || invtype === "electronic";
+}
+
+
+//设置发票抬头详情
+const sellerInvoiceTitle = ref<Record<string, string>>({});
+const purchaserInvoiceTitle = ref<Record<string, string>>({});
+
+function handleInvoiceTitle(
+  _isSeller: boolean,
+  invoiceTitle: Record<string, string>
+) {
+
+  if (!invoiceTitle) {
+    if (_isSeller) {
+      return (sellerInvoiceTitle.value = {});
+    }
+
+    return (purchaserInvoiceTitle.value = {});
+  }
+
+  if (_isSeller) {
+    //支持的开票方式
+    const { invoiceType, denomination: _denomination } = invoiceTitle;
+    denomination.value = Number(_denomination) * 10000;
+    const chunks = invoiceType.split(",");
+    ruleForm.value.invtype = "";
+
+    invoiceTypes.value = xs_inv_type_list.filter(({ value }) =>
+      chunks.includes(value)
+    );
+  }
+
+  _isSeller
+    ? (sellerInvoiceTitle.value = convertInvoiceTitleData(
+        convertInvoiceTitle(invoiceTitle)
+      ))
+    : (purchaserInvoiceTitle.value = convertInvoiceTitleData( convertInvoiceTitle(invoiceTitle)));
+}
+
+const setSellerInvoiceTitle = handleInvoiceTitle.bind(null, true);
+const setPurchaserInvoiceTitle = handleInvoiceTitle.bind(null, false);
+
+async function handleCompanyChange(companyNo,isSeller  = true) {
+  ruleForm.value[isSeller ? 'companyNo' : 'buyer']  = companyNo;
+  const { code, data, message } = await httpCompanylist({
+    companyNo
+  });
+
+  nextTick(() => {
+    if (formRef.value) {  formRef.value.validateField("companyNo");  }
+  });
+
+  responseHandle({
+    code,
+    message,
+    handler: () => setSellerInvoiceTitle(data.list[0])
+  });
+}
+
+async function handleSupplierChange(name) {
+  ruleForm.value.buyer = name;
+  
+  const { code, data, message } = await httpCompanylist({noRela:true});
+
+  responseHandle({
+    code,
+    message,
+    handler: () => {
+      const item = data.list.find(({ company_name }) => company_name === name);
+
+      console.log(data.list,name)
+      setPurchaserInvoiceTitle(item || {}) 
+    }
+  })
+}
+
+async function handleOpenInv({ orderArr,payNo}) {
+  try {
+    await formRef.value.validate();
+    const { invtype, email, remark, exam_remark } = ruleForm.value
+
+    loading.value = true;
+    const { code, message } = await httpCreate({ invtype, email, remark, exam_remark, orderArr, payNo });
+
+    loading.value = false;
+
+      responseHandle({
+       code,
+       message,
+       handler: () => push("/InvoiceSales/invoiceApply")
+     });
+  } catch (err) { 
+    console.log(err);
+  }
+}
+
+onMounted(() => handleCompanyChange(currentCompany.value.companyNo));
+</script>
+
+<template>
+  <div class="addEditForm">
+    <el-form
+      ref="formRef"
+      v-loading="loading"
+      :model="ruleForm"
+      :rules="rules"
+      status-icon
+      size="small"
+    >
+      <el-row gutter="10">
+        <el-col :span="12">
+          <el-form-item
+            label="销售方公司抬头"
+            prop="companyNo"
+          >
+            <el-select
+              style="width: 100%"
+              placeholder="销售方公司抬头"
+              disabled
+              v-model="ruleForm.companyNo"
+            >
+              <el-option
+                v-for="c in companyList"
+                :key="c.companyCode"
+                :value="c.companyCode"
+                :label="c.companyName"
+              />
+            </el-select>
+          </el-form-item>
+
+          <InvoiceTitle :detail="sellerInvoiceTitle" />
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item
+            label="购买方公司抬头"
+            prop="companyNo"
+          >
+            <el-select
+              style="width: 100%"
+              placeholder="购买方公司抬头"
+              disabled
+              v-model="ruleForm.buyer"
+            >
+              <el-option
+                v-for="c in companyList"
+                :key="c.companyCode"
+                :value="c.companyCode"
+                :label="c.companyName"
+              />
+            </el-select>
+          </el-form-item>
+
+          <InvoiceTitle v-if="ruleForm.buyer" :detail="purchaserInvoiceTitle" />
+        </el-col>
+
+        <el-col :span="6">
+          <el-form-item label="发票类型" prop="invtype">
+            <el-select
+              v-model="ruleForm.invtype"
+              style="width: 100%"
+              @change="menu_type_change"
+              placeholder="发票类型"
+              no-data-text="请选择其他销售方公司"
+            >
+              <el-option
+                v-for="si in invoiceTypes"
+                :key="si.value"
+                :label="si.label"
+                :value="si.value"
+              />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item label="电子邮箱" prop="email">
+            <el-input v-model="ruleForm.email" placeholder="电子邮箱" />
+          </el-form-item>
+
+          <!-- <el-form-item
+            label="平台类型"
+            prop="platform_type"
+          >
+            <el-switch
+              v-model="ruleForm.platform_type"
+              size="small"
+              active-text="toC"
+              inactive-text="toB"
+              active-value="2"
+              inactive-value="1"
+            />
+          </el-form-item>--> 
+        </el-col> 
+
+        <el-col :span="18">
+          <el-form-item label="申请备注" prop="exam_remark">
+            <el-input
+              w-full
+              v-model="ruleForm.exam_remark"
+              :rows="5"
+              type="textarea"
+              maxlength="2000"
+              placeholder="申请备注"
+              show-word-limit
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item label="发票备注" prop="remark">
+            <div w-full>
+              <el-input
+                w-full
+                v-model="ruleForm.remark"
+                :rows="3"
+                type="textarea"
+                maxlength="2000"
+                show-word-limit
+                placeholder="发票备注"
+              />
+            </div>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item label="订单对账">
+            <ChooseForm @openInv="handleOpenInv" @get-buyer="buyer => {
+              handleSupplierChange(buyer);
+            }" :platformType="ruleForm.platform_type" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-descriptions) {
+  padding: 0px !important;
+  padding-left: 30px !important;
+  padding-bottom: 10px !important;
+}
+</style>

+ 45 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/choose-form.vue

@@ -0,0 +1,45 @@
+<script setup lang="ts">
+import { ref, unref } from "vue";
+import ReconciliationForm from "/@/components/ReconciliationForm";
+import { ElForm, ElMessage } from "element-plus";
+import ChooseModal from "./choose-modal.vue";
+
+const emit = defineEmits(["create", "openInv", "getBuyer"]);
+
+ defineProps<{
+  platformType: string
+}>();
+
+const formRef = ref<InstanceType<typeof ElForm> | null>(null);
+const chooseModalRef = ref<InstanceType<typeof ChooseModal> | null>(null);
+const reconciliationRef = ref<InstanceType<typeof ReconciliationForm> | null>(null);
+
+const formData = ref({ payNo: "" });
+
+const handleChoose = () => chooseModalRef.value?.onDisplay();
+
+function handleDetail(data) {
+  emit('getBuyer', data.supplierName)
+}
+
+</script>
+
+<template>
+  <div w-full>
+    <ReconciliationForm
+      ref="reconciliationRef"
+      :cover="true"
+      isPurchPay
+      :edit="true"
+      :platformType="platformType"
+      :id="formData.payNo"
+      :readonly="!!formData.payNo"
+      @get-record="handleDetail"
+      @choose="handleChoose"
+      @clear="formData.payNo = ''"
+      @openInv="orderArr => emit('openInv', orderArr)"
+   />
+
+    <ChooseModal ref="chooseModalRef" :platformType="platformType"  @choose="payNo => (formData.payNo = payNo)" />
+  </div>
+</template>

+ 252 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/choose-modal.vue

@@ -0,0 +1,252 @@
+<script setup lang="ts">
+import { ref, unref, reactive } from "vue";
+import { ElMessage, ElTable } from "element-plus";
+import { columns } from "./config/_details";
+import { useResponseHandle } from "/@/hooks";
+import { httpList } from "/@/api/purchase/orderRecord";
+import { useCompany } from "/@/hooks/core/useCompany";
+import { payStatusOptions, tagOptions } from "/@/utils/status";
+import { SupplierQuery, DateRange } from "/@/components/BasicForm";
+
+const emit = defineEmits(["choose"]);
+
+const props = defineProps<{
+  platformType:string
+}>();
+
+const visible = ref(false);
+const paymentList = ref<Array<Record<string, string>>>([]);
+const selects = ref<Array<Record<string, string>>>([]);
+
+const { currentCompany } = useCompany();
+
+const pagination = reactive({
+  total: 0,
+  size: 15,
+  page: 1,
+  background: true
+});
+
+const formData = ref<Record<string, any>>({
+  pay_status: "0",
+  supplierNo: "",
+  currentValue: "",
+  tag_id: "",
+  timer: []
+});
+
+const tableRef = ref<InstanceType<typeof ElTable> | null>(null);
+const currentKey = ref("payNo");
+const loading = ref(false);
+const responseHandle = useResponseHandle();
+
+//初始化订单对账列表
+async function requestPaymentList() {
+  const { size, page } = pagination;
+  loading.value = true;
+
+  const { currentValue, timer, ...otherParams } = formData.value;
+
+  const { code, message, data } = await httpList({
+    pay_status: "0",
+    status: "2",
+    is_comon:"1",
+    [currentKey.value]: currentValue,
+    companyNo: currentCompany.value.companyNo,
+    startTime: timer[0],
+    endTime: timer[1],
+    platform_type: props.platformType,
+    ...otherParams,
+    page,
+    size
+  });
+
+  responseHandle({
+    code,
+    message,
+    handler: () => {
+      pagination.total = data.count;
+      paymentList.value = data.list;
+    }
+  });
+  loading.value = false;
+}
+
+function handleConfirm() {
+  const [order] = selects.value;
+  if (!order) return ElMessage.warning("请选择一个对账单");
+  emit('choose',order.payNo)
+  visible.value = false;
+}
+
+function handleSelectionChange(values) {
+  if (values.length > 1) {
+    const value = values.pop();
+    tableRef.value?.clearSelection();
+    tableRef.value?.toggleRowSelection(value, true);
+    selects.value = [value];
+  } else {
+    selects.value = [values[0]];
+  }
+}
+
+function handleSizeChange() {
+  pagination.page = 1;
+  requestPaymentList();
+}
+
+function handleSearch(_isReset?: boolean) {
+  if (_isReset) {
+    formData.value = {
+      pay_status: "0",
+      supplierNo: "",
+      currentValue: "",
+      tag_id: "",
+      timer: []
+    };
+  }
+
+  pagination.page = 1;
+  requestPaymentList();
+}
+
+defineExpose({
+  onDisplay: () => (visible.value = true)
+});
+</script>
+
+<template>
+  <el-dialog
+    :close-on-click-modal="false"
+    v-model="visible"
+    title="订单对账"
+    center
+    width="1040px"
+    top="10px"
+    @open="() => requestPaymentList()"
+  >
+    <el-form size="small">
+      <el-row :gutter="8">
+        <el-col :span="8">
+          <el-form-item>
+            <el-input
+              clearable
+              v-model="formData.currentValue"
+              placeholder="请输入"
+            >
+              <template #prepend>
+                <el-select v-model="currentKey" style="width: 130px">
+                  <el-option label="对账编码" value="payNo" />
+                </el-select>
+              </template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <date-range v-model="formData.timer" />
+        </el-col>
+
+        <el-col :span="8">
+          <supplier-query
+            v-model="formData.supplierNo"
+            placeholder="卖出方公司"
+          />
+        </el-col>
+
+        <el-col :span="6">
+          <el-form-item>
+            <el-select
+              w-80
+              v-model="formData.pay_status"
+              placeholder="付款状态"
+            >
+              <el-option value="0" label="未付款或部分付款" />
+              <el-option value="1" label="未付款" />
+              <el-option value="2" label="部分付款" />
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="6">
+          <el-form-item>
+            <el-select w-80 v-model="formData.tag_id" placeholder="标签状态">
+              <el-option
+                v-for="tag in tagOptions"
+                :key="tag.value"
+                :value="tag.value"
+                :label="tag.label"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item>
+            <el-button type="primary" @click="() => handleSearch()"
+              >搜索</el-button
+            >
+            <el-button @click="() => handleSearch(true)">重置</el-button>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <el-table
+      border
+      ref="tableRef"
+      :data="paymentList"
+      size="small"
+      row-key="id"
+      @selection-change="handleSelectionChange"
+      mb-2
+      v-loading="loading"
+      max-height="520px"
+    >
+      <el-table-column type="selection" align="center" width="40" />
+      <el-table-column
+        v-for="(col, index) in columns"
+        :key="index"
+        v-bind="col"
+        show-overflow-tooltip
+      >
+        <template #="{ row }">
+          <el-tag v-if="col.prop === 'pay_status'" size="small">{{
+            payStatusOptions.find(p => p.value === String(row.pay_status))
+              ?.label
+          }}</el-tag>
+
+          <span v-else>{{ row[col.prop] }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <div flex>
+      <el-pagination
+        v-model:current-page="pagination.page"
+        v-model:page-size="pagination.size"
+        :total="pagination.total"
+        :page-sizes="[15, 50, 100]"
+        layout="sizes, prev, pager, next"
+        @current-change="requestPaymentList"
+        @size-change="handleSizeChange"
+      />
+
+      <div w-full flex justify-end mt-2>
+        <el-button type="primary" size="small" @click="handleConfirm"
+          >保存</el-button
+        >
+      </div>
+    </div>
+
+    <ChooseEditModal ref="chooseEditModalRef" />
+  </el-dialog>
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-table__header) {
+  .el-checkbox {
+    display: none;
+  }
+}
+</style>

+ 63 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/_details.ts

@@ -0,0 +1,63 @@
+export const columns = [
+  {
+    label: "对账编码",
+    prop: "payNo",
+    minWidth: 160,
+    align: "left"
+  },
+  {
+    label: "供应商编码",
+    prop: "supplierNo",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "供应商名称",
+    prop: "supplierName",
+    minWidth: 180,
+    align: "left"
+  },
+  {
+    label: "业务公司编码",
+    prop: "companyNo",
+    minWidth: 150
+  },
+  {
+    label: "业务公司名称",
+    prop: "companyName",
+    minWidth: 180
+  },
+  {
+    label: "付款状态",
+    prop: "pay_status",
+    minWidth: 100
+  },
+  {
+    label: "总额款",
+    prop: "total_fee",
+    minWidth: 110,
+    align: "total_fee"
+  },
+  {
+    label: "付款标签金额",
+    prop: "pay_tag_fee",
+    minWidth: 110,
+    align: "left"
+  },
+  {
+    label: "已付款金额",
+    prop: "apay_fee",
+    minWidth: 110,
+    align: "left"
+  },
+  {
+    label: "申请人",
+    prop: "apply_name",
+    minWidth: 90
+  },
+  {
+    label: "申请时间",
+    prop: "addtime",
+    minWidth: 120
+  }
+];

+ 12 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/_rules.ts

@@ -0,0 +1,12 @@
+import { FormRules } from "element-plus";
+
+export const createRules: FormRules = {
+  pay_fee: [{ required: true, trigger: "change", message: "请输入付款金额" }],
+  payNo: [
+    {
+      required: true,
+      trigger: "change",
+      message: "请选择付款订单"
+    }
+  ]
+};

+ 116 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/content.config.ts

@@ -0,0 +1,116 @@
+import { ContentConfig } from "/@/components/PageContent";
+import { httpList, httpDelete } from "/@/api/purchase/orderPay";
+
+import { h } from "vue";
+import { ElTag } from "element-plus";
+import { hasAccountOptions, purchPayStatusOptions } from "/@/utils/status";
+import { renderIconLabelLeft, renderProp } from "/@/utils/columnRenderHelper";
+
+const columns = [
+  {
+    label: "对账付款编码",
+    prop: "dzNo",
+    width: 150,
+    align: "left"
+  },
+  {
+    label: "对账编码",
+    prop: "payNo",
+    width: 150
+  },
+  {
+    label: "供应商端",
+    prop: "has_account",
+    width: 80,
+    ...renderProp(hasAccountOptions, "has_account")
+  },
+  {
+    label: "状态",
+    prop: "dstatus",
+    width: 140,
+    cellRenderer: ({ row, props }) =>
+      h(
+        ElTag,
+        {
+          size: props.size
+        },
+        {
+          default: () =>
+            purchPayStatusOptions.find(s => String(row.dstatus) === s.value)
+              ?.label
+        }
+      )
+  },
+  {
+    label: "对账总金额",
+    prop: "total_fee",
+    width: 110
+  },
+  {
+    label: "本次付款金额",
+    prop: "dpay_fee",
+    width: 110,
+    align: "left"
+  },
+  // {
+  //   label: "卖方公司编码",
+  //   prop: "supplierNo",
+  //   width: 150,
+  //   align: "left"
+  // },
+  {
+    label: "卖出方公司",
+    prop: "supplierName",
+    minWidth: 180,
+    ...renderIconLabelLeft("supplierNo", "supplierName", "卖出方公司编码:")
+  },
+  // {
+  //   label: "买方公司编码",
+  //   prop: "companyNo",
+  //   width: 150
+  // },
+  {
+    label: "买入方公司名称",
+    prop: "companyName",
+    minWidth: 180,
+    ...renderIconLabelLeft("companyNo", "companyName", "买入方公司编码:")
+  },
+
+  {
+    label: "申请人",
+    prop: "apply_name",
+    width: 90,
+    align: "left"
+  },
+  {
+    label: "回执时间",
+    width: 140,
+    prop: "return_time"
+  },
+  {
+    label: "申请时间",
+    width: 140,
+    prop: "addtime"
+  },
+  {
+    label: "操作",
+    fixed: "right",
+    width: 100,
+    slot: "operation"
+  }
+];
+
+const contentConfig: ContentConfig = {
+  title: "采购付款",
+  columns,
+  deleteProp: "dzNo",
+  superUserNoAction: true,
+  showDelete: ({ dstatus }) => Number(dstatus) === 1,
+  apis: {
+    httpList,
+    httpDelete,
+    httpAdd: true
+  }
+};
+
+export default contentConfig;

+ 41 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/search.config.ts

@@ -0,0 +1,41 @@
+import { FormConfig } from "/@/components/PageSearch";
+import { purchPayStatusOptions } from "/@/utils/status";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "timer",
+      type: "date_picker",
+      otherOptions: {
+        type: "daterange",
+        startProp: "startTime",
+        endProp: "endTime",
+        startPlaceholder: "开始日期",
+        endPlaceholder: "结束日期"
+      }
+    },
+    {
+      field: "status",
+      type: "select",
+      placeholder: "审核状态",
+      options: purchPayStatusOptions
+    },
+    {
+      field: "supplierNo",
+      type: "supplier-query"
+    },
+
+    {
+      field: "dzNo",
+      type: "input",
+      placeholder: "对账付款编码"
+    },
+    {
+      field: "payNo",
+      type: "input",
+      placeholder: "对账编码"
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 0 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/chooseForm/config/采购付款.md


+ 281 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/columns.tsx

@@ -0,0 +1,281 @@
+import { ref } from "vue";
+import dayjs from "dayjs";
+import { send_status_list } from "/@/utils/status";
+export function useColumns() {
+  const columns = ref([
+    {
+      type: "selection",
+      width: 40,
+      align: "center",
+      fixed: "left"
+    },
+    {
+      label: "销售订单编码",
+      prop: "sequenceNo",
+      width: 150,
+      showOverflowTooltip: true
+    },
+    {
+      label: "销售订单主编码",
+      prop: "cxCode",
+      width: 150,
+      showOverflowTooltip: true
+    },
+    // {
+    //   label: "名称",
+    //   prop: "name",
+    //   minWidth: 160,
+    //   showOverflowTooltip: true
+    // },
+    {
+      label: "平台订单编码",
+      prop: "poCode",
+      width: 150,
+      showOverflowTooltip: true
+    },
+    {
+      label: "商品编码",
+      prop: "goodNo",
+      width: 150,
+      showOverflowTooltip: true
+    },
+    {
+      label: "商品名称",
+      prop: "goodName",
+      minWidth: 160,
+      showOverflowTooltip: true
+    },
+    {
+      label: "平台类型",
+      prop: "platform_type",
+      width: "80px",
+      slot: "platform_type",
+      showOverflowTooltip: true
+    },
+    {
+      label: "发货状态",
+      prop: "sendStatus",
+      width: "95px",
+      showOverflowTooltip: true,
+      cellRenderer: ({ row, props }) => (
+        <el-tag
+          size={props.size}
+          type={
+            (
+              send_status_list.find(
+                item => item.value == row.sendStatus + ""
+              ) || {}
+            ).type || "info"
+          }
+          effect="plain"
+        >
+          {(
+            send_status_list.find(item => item.value == row.sendStatus + "") ||
+            {}
+          ).label || "--"}
+        </el-tag>
+      )
+    },
+    {
+      label: "客户编码",
+      prop: "customerNo",
+      width: 150,
+      showOverflowTooltip: true
+    },
+    {
+      label: "客户名称",
+      prop: "customerName",
+      minWidth: 160,
+      showOverflowTooltip: true
+    },
+    {
+      label: "订单总金额",
+      prop: "totalPrice",
+      width: 110,
+      showOverflowTooltip: true
+    },
+    {
+      label: "商品数量",
+      prop: "goodNum",
+      width: 110,
+      showOverflowTooltip: true
+    },
+    {
+      label: "未开票数量",
+      prop: "winv_num",
+      width: 110
+    },
+    {
+      label: "已开票金额",
+      prop: "ainv_fee",
+      width: 110,
+      showOverflowTooltip: true
+    },
+    {
+      label: "开票中金额",
+      prop: "inv_fee",
+      width: 110,
+      showOverflowTooltip: true
+    },
+    {
+      label: "未开票金额",
+      prop: "winv_fee",
+      width: 110,
+      showOverflowTooltip: true
+    },
+    {
+      label: "业务员",
+      prop: "ownerName",
+      width: 80,
+      showOverflowTooltip: true
+    },
+    {
+      label: "创建时间",
+      width: 140,
+      prop: "createTime",
+      showOverflowTooltip: true,
+      formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
+    }
+  ]);
+
+  return {
+    columns
+  };
+}
+
+export const order_detail_columns = [
+  {
+    field: "sequenceNo",
+    label: "销售订单编码"
+  },
+  {
+    field: "ownerName",
+    label: "销售员"
+  },
+  {
+    field: "department",
+    label: "平台名称"
+  },
+  {
+    field: "goodPrice",
+    label: "商品单价"
+  },
+  {
+    field: "companyName",
+    label: "业务公司名称",
+    span: 12
+  },
+  {
+    field: "customerName",
+    label: "客户名称",
+    span: 12
+  },
+
+  {
+    field: "goodName",
+    label: "商品名称",
+    span: 24
+  },
+  {
+    field: "goodNum",
+    label: "商品总数量"
+  },
+  {
+    field: "ainv_num",
+    label: "已开票数量"
+  },
+  {
+    field: "inv_num",
+    label: "开票中数量"
+  },
+  {
+    field: "winv_num",
+    label: "未开票数量"
+  },
+  {
+    field: "totalPrice",
+    label: "订单总金额"
+  },
+  {
+    field: "ainv_fee",
+    label: "已开票金额"
+  },
+  {
+    field: "inv_fee",
+    label: "开票中金额"
+  },
+
+  {
+    field: "winv_fee",
+    label: "未开票金额"
+  }
+];
+
+/**
+ * @invoice_addr 公司注册地址
+ * @invoice_people  法人
+ * @invoice_mobile 联系方式
+ * @invoice_code 纳税识别号
+ * @invoice_bank 开户行
+ * @invoice_bankNo 开户账户
+ */
+export const convertInvoiceTitle = (title: Record<string, string>) => {
+  const {
+    company_address,
+    mobile,
+    company_license,
+    bank_name,
+    bankNo,
+    company_name
+  } = title;
+
+  return {
+    invoice_addr: company_address,
+    invoice_mobile: mobile,
+    invoice_code: company_license,
+    invoice_bank: bank_name,
+    invoice_bankNo: bankNo,
+    invoice_title: company_name
+  };
+};
+
+export const convertInvoiceTitleData = (title: Record<string, string>) => {
+  const {
+    invoice_addr,
+    invoice_mobile,
+    invoice_code,
+    invoice_bank,
+    invoice_bankNo,
+    invoice_title
+  } = title;
+
+  return {
+    invoice_code,
+    invoice_title,
+    addrAndmobile: invoice_addr + " " + invoice_mobile,
+    bankAndBankNo: invoice_bank + " " + invoice_bankNo
+  };
+};
+
+export const invoice_columns = [
+  {
+    label: "抬头",
+    span: 24,
+    field: "invoice_title"
+  },
+  {
+    label: "纳税人识别号",
+    span: 24,
+    field: "invoice_code"
+  },
+  {
+    label: "地址、电话",
+    span: 24,
+    field: "addrAndmobile"
+  },
+  {
+    label: "开户行及账号",
+    span: 24,
+    field: "bankAndBankNo"
+  }
+];

+ 93 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/edit-order.vue

@@ -0,0 +1,93 @@
+<script setup lang="ts">
+import { computed, ref, unref, watchEffect } from "vue";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+import { order_detail_columns } from "./columns";
+
+const visible = ref(false);
+const data = ref<Record<string, string>>({});
+const emit = defineEmits(["save-btn-click"]);
+
+const total = ref(0);
+const inv_fee = ref(0);
+
+function handleSave() {
+  visible.value = false;
+
+  emit("save-btn-click", {
+    row: unref(data),
+    inv_fee: unref(inv_fee),
+    num: unref(total)
+  });
+}
+
+const totalNum = computed(() => {
+  const { winv_num } = data.value as any;
+  return winv_num;
+});
+
+watchEffect(() => {
+  total.value = totalNum.value;
+});
+
+defineExpose({
+  onDisplay({ row: _data }) {
+    visible.value = true;
+    data.value = _data;
+    inv_fee.value = data.value.winv_fee as any;
+  }
+});
+</script>
+
+<template>
+  <el-dialog
+    v-model="visible"
+    title="编辑销售订单"
+    center
+    width="1040px"
+    :close-on-click-modal="false"
+  >
+    <BasicDescriptions
+      :data="data"
+      :col-number="2"
+      :columns="order_detail_columns"
+    >
+      <template #custom>
+        <el-row>
+          <div class="col-item" style="width: 247px">
+            <p class="col-label">开票数量</p>
+            <p class="col-value">
+              <el-input-number
+                size="small"
+                placeholder="开票数量"
+                :min="0.1"
+                style="width: 100%"
+                :max="totalNum"
+                v-model="total"
+              />
+            </p>
+          </div>
+
+          <div class="col-item" style="width: 248px">
+            <p class="col-label">开票金额</p>
+            <p class="col-value">
+              <el-input-number
+                placeholder="开票金额"
+                :precision="2"
+                :min="0.1"
+                size="small"
+                style="width: 100%"
+                v-model="inv_fee"
+              />
+            </p>
+          </div>
+        </el-row>
+      </template>
+    </BasicDescriptions>
+
+    <div flex w-full justify-end mt-2>
+      <el-button size="small" type="primary" @click="handleSave"
+        >保存</el-button
+      >
+    </div>
+  </el-dialog>
+</template>

+ 20 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/invoice-title.vue

@@ -0,0 +1,20 @@
+<script setup lang="ts">
+import { invoice_columns } from "./columns";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+
+defineProps<{
+  detail: Record<string, string>;
+}>();
+</script>
+
+<template>
+  <BasicDescriptions
+    px-8
+    pb-5
+    v-if="Object.keys(detail).length !== 0"
+    :data="detail"
+    :columns="invoice_columns"
+    :col-number="1"
+    label-width="130"
+  />
+</template>

+ 74 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/order-dialog.vue

@@ -0,0 +1,74 @@
+<script setup lang="ts">
+import { shallowRef, shallowReactive } from "vue";
+import SearchCheck from "./search-check.vue";
+import SeaechBatch from "./search-batch.vue";
+
+enum SearchMode {
+  check,
+  batch
+}
+
+const showModel = shallowRef(false);
+const currentSearchMode = shallowRef(SearchMode.check);
+const emit = defineEmits(["reload", "save-btn-click"]);
+
+const payload = shallowReactive({
+  companyNo: "",
+  platform_type: ""
+});
+
+async function show(_companyNo, _platform_type) {
+  showModel.value = true;
+  payload.companyNo = _companyNo;
+  payload.platform_type = _platform_type;
+}
+
+function handleConfirm(selected) {
+  emit("save-btn-click", selected);
+  showModel.value = false;
+}
+
+defineExpose({
+  show
+});
+</script>
+
+<template>
+  <el-dialog
+    top="5vh"
+    center
+    v-model="showModel"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    destroy-on-close
+    title="添加销售订单"
+    :width="'1040px'"
+  >
+    <el-switch
+      v-model="currentSearchMode"
+      active-text="批量查找"
+      inactive-text="勾选查找"
+      :active-value="SearchMode.batch"
+      :inactive-value="SearchMode.check"
+    />
+
+    <template v-if="currentSearchMode === SearchMode.check">
+      <SearchCheck :payload="payload" @confirm="handleConfirm" />
+    </template>
+
+    <template v-else>
+      <SeaechBatch :payload="payload" @confirm="handleConfirm" />
+    </template>
+  </el-dialog>
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-pagination) {
+  justify-content: flex-start !important;
+}
+
+.search {
+  padding: 0px !important;
+}
+</style>

+ 160 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/search-batch.vue

@@ -0,0 +1,160 @@
+<script setup lang="ts">
+import { reactive, ref, shallowRef, unref } from "vue";
+import { httpBatchOrderList } from "/@/api/InvoiceSales/invoiceApply";
+import { responseHandle } from "/@/utils/responseHandle";
+import { useNav } from "/@/layout/hooks/nav";
+import { ElMessage } from "element-plus";
+import { useColumns } from "./columns";
+import { useTypeOptions } from "/@/utils/status";
+
+const emit = defineEmits(["reload", "confirm"]);
+
+const { columns } = useColumns();
+
+columns.value = columns.value.slice(1);
+
+const { logout } = useNav();
+const loading = ref(false);
+const selected = ref([]);
+const tableRef = ref();
+
+const pagination = reactive({
+  total: 0,
+  pageSize: 15,
+  currentPage: 1,
+  background: true,
+  pageSizes: [15, 50, 100]
+});
+
+const props = defineProps<{
+  payload: object;
+}>();
+
+const sourceText = shallowRef("");
+//列表展示
+async function onSearch(sequenceNo = []) {
+  loading.value = true;
+  const { currentPage: page, pageSize: size } = pagination;
+  const { code, data, message } = await httpBatchOrderList({
+    ...props.payload,
+    sequenceNo: sequenceNo.join(","),
+    inv_is: "1",
+    cat_status: "2",
+    inv_status: "0",
+    page,
+    size
+  });
+
+  responseHandle({
+    code,
+    message,
+    logout,
+    handler: () => {
+      // const { li } = data ?? {};
+      selected.value = data ?? [];
+      // pagination.total = count ?? 0;
+      sourceText.value = "";
+    }
+  });
+  loading.value = false;
+}
+
+const $space = " ";
+const $wrap = "\n";
+const replaceTextWrapAndSpace = function (text = "") {
+  if (!text) return "";
+  let _text = text;
+  const hasSpace = _text.includes($space);
+  const hasWrap = _text.includes($wrap);
+  if (hasSpace) _text = _text.split($space).join("");
+  if (hasWrap) _text = _text.split($wrap).join("");
+  return _text;
+};
+
+function handleEnter() {
+  const text = replaceTextWrapAndSpace(sourceText.value);
+  /* 去掉回车和空格 **/
+  if (text.length === 0) {
+    ElMessage.warning("不能解析空文本");
+    sourceText.value = text;
+    return;
+  }
+
+  /* 统一替换字符 **/
+  const parserText = text.replace(/[,。;、; .]/g, ",");
+  const sequenceNo = parserText.split(",");
+  onSearch(sequenceNo);
+}
+
+function handleConfirm() {
+  if (selected.value.length === 0) {
+    return ElMessage.error("至少添加一个销售订单!");
+  }
+
+  //商品数量或开票金额为空
+  const noConfirm = selected.value.filter(o => o.winv_fee === "0.00");
+  const noInvNum = selected.value.filter(o => String(o.winv_num) === "0");
+
+  if (noConfirm.length !== 0) {
+    return ElMessage.error(`销售订单 ${noConfirm[0].sequenceNo} 开票金额为零`);
+  }
+
+  if (noInvNum.length !== 0) {
+    return ElMessage.error(`销售订单 ${noInvNum[0].sequenceNo} 开票数量为零`);
+  }
+
+  emit("confirm", unref(selected));
+}
+</script>
+
+<template>
+  <div relative>
+    <ElInput
+      :rows="4"
+      v-model="sourceText"
+      style="margin-bottom: 10px"
+      placeholder="输入销售单编码(小于100条),系统支持的分割符为逗号(,)、句号(.)、分号(;)、顿号(、),回车后开始解析。"
+      type="textarea"
+      @keydown.enter="handleEnter"
+    />
+
+    <div v-loading="loading">
+      <PureTable
+        ref="tableRef"
+        border
+        align="left"
+        row-key="id"
+        table-layout="auto"
+        :size="'small'"
+        :data="selected"
+        :columns="columns"
+        max-height="560px"
+        :header-cell-style="{ background: '#fafafa', color: '#606266' }"
+      >
+        <template #platform_type="scope">
+          <el-tag>{{
+            useTypeOptions.find(
+              ({ value }) => value === scope.row.platform_type
+            )?.label || "--"
+          }}</el-tag>
+        </template>
+      </PureTable>
+    </div>
+
+    <div class="flex justify-end mt-10px">
+      <el-button type="primary" @click="handleConfirm" size="small"
+        >保存</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-pagination) {
+  justify-content: flex-start !important;
+}
+
+.search {
+  padding: 0px !important;
+}
+</style>

+ 179 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/search-check.vue

@@ -0,0 +1,179 @@
+<script setup lang="ts">
+import { reactive, ref, unref } from "vue";
+import { httpOrderList } from "/@/api/InvoiceSales/invoiceApply";
+import { PageSearch, usePageSearch } from "/@/components/PageSearch";
+import searchFormConfig from "./search.config";
+import { responseHandle } from "/@/utils/responseHandle";
+import { useNav } from "/@/layout/hooks/nav";
+import { ElMessage } from "element-plus";
+import { useColumns } from "./columns";
+import { useTypeOptions } from "/@/utils/status";
+
+const { columns } = useColumns();
+const { logout } = useNav();
+const loading = ref(false);
+const dataList = ref([]);
+const selected = ref([]);
+const tableRef = ref();
+
+const pagination = reactive({
+  total: 0,
+  pageSize: 15,
+  currentPage: 1,
+  background: true,
+  pageSizes: [15, 50, 100]
+});
+
+const props = defineProps<{
+  payload: object;
+}>();
+
+const emit = defineEmits(["confirm"]);
+let otherParams: Record<any, any> = {};
+const ruleForm = ref({});
+const { handleSearchClick, handleResetClick } = usePageSearch(
+  params => {
+    otherParams = params;
+    pagination.currentPage = 1;
+    onSearch();
+
+    return {
+      result: {},
+      deleteProps: []
+    };
+  },
+  () => {
+    otherParams = {};
+    onSearch();
+  }
+);
+
+const handleCurrentChange = (current: number) => {
+  pagination.currentPage = current;
+  onSearch();
+};
+
+function handleReset() {
+  pagination.currentPage = 1;
+  pagination.pageSize = 15;
+  handleResetClick();
+}
+
+function selectedChange(val) {
+  selected.value = val;
+}
+
+//列表展示
+async function onSearch() {
+  loading.value = true;
+  const { currentPage: page, pageSize: size } = pagination;
+  const { code, data, message } = await httpOrderList({
+    ...props.payload,
+    inv_is: "1",
+    cat_status: "2",
+    inv_status: "0",
+    ...otherParams,
+    page,
+    size,
+    ...ruleForm.value
+  });
+
+  responseHandle({
+    code,
+    message,
+    logout,
+    handler: () => {
+      const { list, count } = data ?? {};
+      dataList.value = list ?? [];
+      pagination.total = count ?? 0;
+    }
+  });
+  loading.value = false;
+}
+
+function handleSizeChange(val) {
+  pagination.pageSize = val;
+  pagination.currentPage = 1;
+  onSearch();
+}
+
+function handleConfirm() {
+  if (selected.value.length === 0) {
+    return ElMessage.error("至少添加一个销售订单!");
+  }
+
+  //商品数量或开票金额为空
+  const noConfirm = selected.value.filter(o => o.winv_fee === "0.00");
+  const noInvNum = selected.value.filter(o => String(o.winv_num) === "0");
+
+  if (noConfirm.length !== 0) {
+    return ElMessage.error(`销售订单 ${noConfirm[0].sequenceNo} 开票金额为零`);
+  }
+
+  if (noInvNum.length !== 0) {
+    return ElMessage.error(`销售订单 ${noInvNum[0].sequenceNo} 开票数量为零`);
+  }
+
+  emit("confirm", unref(selected));
+}
+
+onSearch();
+</script>
+
+<template>
+  <div relative>
+    <PageSearch
+      class="search"
+      @reset-btn-click="handleReset"
+      @search-btn-click="handleSearchClick"
+      :form-config="searchFormConfig"
+    />
+    <div v-loading="loading">
+      <PureTable
+        ref="tableRef"
+        border
+        align="left"
+        row-key="id"
+        table-layout="auto"
+        :size="'small'"
+        :data="dataList"
+        :columns="columns"
+        :pagination="pagination"
+        :paginationSmall="true"
+        max-height="560px"
+        :header-cell-style="{ background: '#fafafa', color: '#606266' }"
+        @selection-change="selectedChange"
+        @current-change="handleCurrentChange"
+        @size-change="handleSizeChange"
+      >
+        <template #platform_type="scope">
+          <el-tag>{{
+            useTypeOptions.find(
+              ({ value }) => value === scope.row.platform_type
+            )?.label || "--"
+          }}</el-tag>
+        </template>
+      </PureTable>
+    </div>
+
+    <el-button
+      absolute
+      bottom-0px
+      right="20px"
+      type="primary"
+      @click="handleConfirm"
+      size="small"
+      >保存</el-button
+    >
+  </div>
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-pagination) {
+  justify-content: flex-start !important;
+}
+
+.search {
+  padding: 0px !important;
+}
+</style>

+ 32 - 0
src/views/InvoiceSales/invoiceApply/components/currentcy-form/search.config.ts

@@ -0,0 +1,32 @@
+import { FormConfig } from "/@/components/PageSearch";
+import { INV_OPEN_STATUS } from "/@/utils/details/inv-open";
+
+const searchFormConfig: FormConfig = {
+  colLayout: { span: 8 },
+  formItems: [
+    {
+      field: "customer",
+      type: "input",
+      placeholder: "客户名称"
+    },
+    {
+      field: "sequenceNo",
+      type: "input",
+      placeholder: "销售订单编码"
+    },
+    {
+      field: "cxCode",
+      type: "input",
+      placeholder: "销售订单主编码"
+    },
+    {
+      field: "status",
+      type: "select",
+      placeholder: "状态",
+      span: 4,
+      options: INV_OPEN_STATUS
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 1 - 1
src/views/InvoiceSales/invoiceApply/config/content.config.ts

@@ -16,7 +16,7 @@ import { renderIconLabelLeft } from "/@/utils/columnRenderHelper";
 const open_type_list = [
   { value: "1", label: "金税开票金税验票" },
   { value: "2", label: "金税开票线下验票" },
-  { value: "3", label: "线下开票线下票" }
+  { value: "3", label: "线下开票线下票" }
 ];
 
 const columns = [

+ 12 - 1
src/views/InvoiceSales/invoiceApply/detail.vue

@@ -9,6 +9,7 @@ import InvoiceDetailVue from "./components/invoice-detail/index.vue";
 import AddEditForm from "./components/add-edit-form/add-edit-form.vue";
 import { useUserInfo } from "/@/hooks/core/useUser";
 import { usePermission } from "/@/hooks/core/usePermission";
+import CurrentcyForm from "./components/currentcy-form/add-edit-form.vue";
 
 import {
   httpCompanyList,
@@ -22,6 +23,10 @@ const { query } = useRoute();
 const responseHandle = useResponseHandle();
 const { isSuperUser } = useUserInfo();
 
+const radioValue = ref("通用订单");
+
+const isOtherOrder = computed(() => radioValue.value === "其他");
+
 const PageName = "invoiceApplyDetail";
 //   { code: "025", name: "财务审核" },
 const { hasPermissionWithCode } = usePermission(PageName);
@@ -143,7 +148,13 @@ onMounted(() => {
   <div class="main bg-white" v-loading="loading">
     <el-tabs v-model="activeName" type="border-card">
       <el-tab-pane label="新建发票申请" name="0" v-if="isCreate">
-        <AddEditForm />
+        <ElRadioGroup v-model="radioValue">
+          <ElRadio label="通用订单" />
+          <ElRadio label="其他"/>
+        </ElRadioGroup>
+
+        <AddEditForm v-if="isOtherOrder" />
+        <CurrentcyForm v-else />
       </el-tab-pane>
 
       <el-tab-pane label="业务详情" name="1" v-if="!isCreate">

+ 9 - 17
src/views/InvoiceSales/invoiceApply/index.vue

@@ -12,39 +12,33 @@ import { useAsync } from "/@/hooks/core/useAsync";
 import ExeclUpload from "./components/execl-files-upload/index.vue";
 import { httpRequsetExport } from "/@/utils/export";
 import { template } from "./config/xls-template";
-import { writeFile, utils } from "xlsx";
 import { usePermission } from "/@/hooks/core/usePermission";
 import ApprovalModal from "./components/approval-modal.vue";
-import { ElMessage } from "element-plus";
 import BackModal from "./components/back-modal.vue";
+import { ElMessage } from "element-plus";
+import { writeFile, utils } from "xlsx";
 
 const PageName = "invoiceApply";
+
 //   { code: "040", name: "批量审核" },
 //   { code: "026", name: "导出发票申请信息" },
 //   { code: "027", name: "下载发票信息导入模板" },
 //   { code: "028", name: "批量导入财务开票结果(发票申请)" },
+
 const { hasPermissionWithCode } = usePermission(PageName);
 const loading = ref(false);
 const baseUrl = "/InvoiceSales/invoiceApplyDetail";
 const postModalRef = ref<InstanceType<typeof PostModal> | null>(null);
 const execlUploadRef = ref<InstanceType<typeof ExeclUpload> | null>(null);
 const approvalModalRef = ref<InstanceType<typeof ApprovalModal> | null>(null);
-const backModalRef = ref<InstanceType<typeof BackModal>>(null);
+const backModalRef = ref<InstanceType<typeof BackModal> | null>(null);
 const { isSuperUser } = useUserInfo();
 const instance = ref(null);
 
-const { run } = useAsync({
-  success: () => instance.value.onSearch()
-});
-
-const { run: approval } = useAsync({
-  success: () => instance.value.onSearch()
-});
-
-const handleApproval = ({ invNo }) => {
-  approval(httpStatus({ invNo, status: "7" }));
-};
+const { run } = useAsync({ success: () => instance.value.onSearch() });
+const { run: approval } = useAsync({ success: () => instance.value.onSearch() });
 
+const handleApproval = ({ invNo }) => approval(httpStatus({ invNo, status: "7" }));
 const { push } = useRouter();
 const selected = ref<any[]>([]);
 
@@ -71,9 +65,7 @@ async function onDownloadOpenInv() {
     onStart: () => (loading.value = true),
     onSuccess: () => (loading.value = false),
     onFail: () => (loading.value = false),
-    params: {
-      ...instance.value.getBasicParams()
-    }
+    params: {  ...instance.value.getBasicParams() }
   });
 }
 

+ 1 - 4
src/views/dashboard/performanceReport/config/company.config.ts

@@ -57,6 +57,7 @@ const contentConfig = (companyNo): ContentConfig => ({
   superUserNoAction: false,
   handleData(data = [], params = {}) {
     const isBeforeDate = params.daytime ? getDiffDay(params.daytime) < 0 && params.companyNo === "GS2302231323386950" : false
+
     const { monthinfo = [], dayinfo = [], total_tips = 0 } = data[0] || [];
 
     monthinfo[1] = {
@@ -98,10 +99,6 @@ const contentConfig = (companyNo): ContentConfig => ({
       const _dayinfo = dayinfo.find(day => String(day.type) === type) || {}
       const msale_total = subtraction(_monthinfo.msale_total, _monthinfo.mth_total) || 0
 
-      if (companyNo === 'GS2304031312553746') {
-        console.log(msale_total)
-      }
-
       const total = subtraction(_total.month, _total.monthReturn)
 
       return {

+ 1 - 1
src/views/purchase/orderRecord/config/search.config.ts

@@ -26,7 +26,7 @@ const searchFormConfig: FormConfig = {
       options: statusOptions
     },
     {
-      field: "status",
+      field: "tag_id",
       type: "select",
       placeholder: "标签状态",
       span: 4,

BIN
src/views/purchase/purchPay/component/.choose-modal.vue.swo


BIN
src/views/purchase/purchPay/component/.choose-modal.vue.swp