Kaynağa Gözat

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-mini-web

zhoux 1 yıl önce
ebeveyn
işleme
aeaca908b9

+ 3 - 3
package.json

@@ -55,7 +55,8 @@
     "tinymce": "^5.10.7",
     "v-click-outside-x": "^4.1.3",
     "v-viewer": "^1.6.4",
-    "vconsole": "^3.15.0",
+    "vant": "^2.12.39",
+    "vconsole": "^3.15.1",
     "view-design": "^4.7.0",
     "vue-clipboard2": "^0.3.1",
     "vue-drag-resize": "^1.5.4",
@@ -70,8 +71,7 @@
     "vuex": "^3.0.1",
     "vuex-persistedstate": "^2.5.4",
     "vxe-table": "3.5.9",
-    "xe-utils": "^3.5.7",
-    "vant": "^2.12.39"
+    "xe-utils": "^3.5.7"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "^3.0.1",

+ 10 - 0
src/api/pages/home/home.js

@@ -20,3 +20,13 @@ export default {
   }
 }
 
+/**
+ * @desc   : 首页路由
+ * @author : 付斌
+ * @date   : 2024-02-01 16:03
+ */
+export const routeUrl = {
+  home: {
+    beginnersGuide: {key: 'beginnersGuide', routeName: 'beginners-guide'},
+  }
+}

+ 12 - 0
src/api/pages/outh/outhActivity.js

@@ -0,0 +1,12 @@
+/**
+ * @desc   : 活动管理
+ * @author : 付斌
+ * @date   : 2024-06-20 11:41
+ */
+export default {
+  outhActivityService: {
+    prefix: 'oauth-server/activity/',
+    // 查询轮播图
+    getActivity: 'list_by',
+  },
+}

+ 10 - 0
src/api/pages/report/detail-report.js

@@ -49,6 +49,16 @@ export default {
     getMacPayCurrentReport: "get_mac_pay_current_report",
     // 供应商往来账表-明细
     getMacPayCurrentItemReport: "get_mac_pay_current_item_report",
+    // 销售利润
+    getSaleProfit:'get_sale_profit',
+    // 查询部门利润
+    getSaleProfitGroupByOrg:'get_sale_profit_group_by_org',
+    // 查询业务员利润
+    getSaleProfitGroupByStaff:'get_sale_profit_group_by_staff',
+    // 查询商品利润
+    getSaleProfitGroupBySku:'get_sale_profit_group_by_sku',
+    // 经营概况
+    getBusinessOverview:'get_business_overview',
   }
 }
 

+ 4 - 0
src/api/pages/sale/order-item.js

@@ -8,6 +8,10 @@ export default {
     prefix: '/mdm-server/sale/orderItem/',
     //以销定采
     purchaseBasedOnSaleSelectOrder:'purchase_based_on_sale_select_order',
+    // 销售出库页面选择源单
+    selectBySaleOut:'select_by_sale_out',
+    //销售出库页面选择源单条件查询分页
+    selectBySaleOutByPage:'select_by_sale_out_by_page',
   }
 }
 

BIN
src/assets/images/dkic-code.png


+ 37 - 1
src/components/business/select-magnifier/setting.js

@@ -303,7 +303,43 @@ const data = {
       {field: 'whCode', width: 'auto'},
       {field: 'whName', width: 'auto'},
     ],
-  }
+  },
+  // 销售出库选来源单号
+  saleOrderOutFromNo: {
+    // 接口文件
+    serviceStr: 'orderItemService',
+    // 下拉的查询方法
+    methodsName: 'selectBySaleOutByPage',
+    // 放大镜查询方法
+    methodsNameDetail: 'selectBySaleOutByPage',
+    // 查询条件
+    searchContent: [
+      {itemCode: 'orderNo'},
+    ],
+    // 查询条件一行个数
+    colCount: 2,
+    // 弹窗的宽度
+    modalWidth: 550,
+    // 列表主键Id
+    selectKey: 'orderId',
+    // 列表主键名称
+    selectLabel: 'orderNo',
+    // 列表列
+    columns: [
+      {field: 'orderNo', minWidth: '40'},
+      {field: 'itemQty', minWidth: '40'},
+      {field: 'canOutQty', minWidth: '40'},
+      {field: 'cusName', minWidth: '40'},
+      {field: 'cusCode', minWidth: '40'},
+      {field: 'cusPhone', minWidth: '40'},
+      {field: 'skuCode', minWidth: '40'},
+      {field: 'skuModel', minWidth: '40'},
+      {field: 'skuName', minWidth: '40'},
+      {field: 'brandName', minWidth: '40'},
+      {field: 'shortName', minWidth: '40'},
+      {field: 'channelName', minWidth: '40'},
+    ],
+  },
 }
 
 

+ 26 - 1
src/components/business/table-select/table-select.vue

@@ -1130,8 +1130,33 @@ export default {
      * @date   : 2022/3/16 18:12
      */
     setMagnifierProperty() {
+      //供应商
       // 部门
-      if (this.dataType === this.$config.tableSelectType.organization) {
+      if (this.dataType === this.$config.tableSelectType.supplier) {
+        this.service = this.$service.commonService
+        this.methodsName = 'getSupplier'
+        this.methodsNameDetail = 'getSupplierByPage'
+        this.searchContent = [
+          {
+            valueFormat: {code: 'supplierName'},
+            valueKind: 'STR'
+          }
+        ]
+        this.modalWidth = 650
+        this.colCount = 2
+        this.selectKey = 'supplierId'
+        this.selectLabel = 'supplierName'
+        this.columns = [
+          {field: 'supplierCode', minWidth: '40'},
+          {field: 'supplierName', minWidth: '40'},
+        ]
+        this.columnsDetail = [
+          {field: 'supplierCode', minWidth: '40'},
+          {field: 'supplierName', minWidth: '40'},
+        ]
+      }
+      // 部门
+      else if (this.dataType === this.$config.tableSelectType.organization) {
         this.service = this.$service.commonService
         this.methodsName = 'getOrganization'
         this.methodsNameDetail = 'getOrganizationByPage'

+ 6 - 1
src/config/index.js

@@ -412,6 +412,7 @@ export default {
    */
   kindCode: {
     supplierPur: '供应商类别-采购',
+    supplierOutsourced: '供应商类别-外协',
     supplierService: '供应商类别-服务',
     serviceDelivery: '服务类别-配送',
     serviceInstall: '服务类别-安装',
@@ -702,7 +703,9 @@ export default {
     //供应商与对象
     supplierAndCustomer: 'supplierAndCustomer',
     //组织机构
-    organization: 'organization'
+    organization: 'organization',
+    //销售出库选来源单号
+    saleOrderOutFromNo:'saleOrderOutFromNo',
   },
   /**
    * @desc   : 收款完成
@@ -739,6 +742,8 @@ export default {
     goodsCategory: 'goodsCategory',
     //其他入库
     goodsForInto: 'goodsForInto',
+    //供应商
+    supplier: 'supplier',
 
   },
 

+ 10 - 0
src/libs/update-columns/index.js

@@ -284,4 +284,14 @@ export default {
     {updateField: 'decimalPlaces' , valueFiled: 'decimalPlaces'},
   ],
 
+  /**
+   *   @desc   : 销售订单外协品选供应商
+   *   @date   : 2024/6/18 15:37
+   *   @author : 寇珊珊
+   */
+   saleOrderChooseSupplier: [
+    {updateField: 'supId', valueFiled: 'supplierId'},
+    {updateField: 'supName', valueFiled: 'supplierName'},
+  ],
+
 }

+ 22 - 1
src/locale/lang/zh-CN.js

@@ -309,7 +309,7 @@ export const columns = {
   priceSale: '售价',
   factPrice: '优惠后单价',
   itemAmt: '售价金额',
-  totalFactAmt: '实收金额',
+  totalFactAmt: '折后金额',
   factAmt: '优惠后金额',
   discAmt: '优惠金额',
   priceDiscount: '标价折扣',
@@ -377,6 +377,7 @@ export const columns = {
   purchaseReal:'采购成交',
   intoNo:'入库单号',
   fromNo:'来源单号',
+  fromIdList:'来源单号',
   waitEntry:'待入库',
   ingEntry:'已入库',
   itemIntoAmt:'入库金额',
@@ -615,6 +616,7 @@ export const columns = {
   ordTypeName:'销售订单类型',
   startAmount:'期初余额',
   costPrice:'入库核对单价',
+  costPriceSaleOrder:'成本单价',
   costAmt:'入库核对金额',
   personUser:'负责人',
   intoItemPrice:'入库价',
@@ -696,6 +698,16 @@ export const columns = {
   flgToPrice:'开启价格体系',
   flgOpeningInv:'开启期初库存',
   flgCostCheckName:'核对标识',
+  ordinaryGoods: '普通商品',
+  outsourcedGoods: '外协商品',
+  outboundProcessingFlag: '开单并出库办理',
+  flgAutoHandle: '自动办理标识',
+  flgHandleSetting: '欠货出库',
+  primaryQty: '可编辑数量',
+  canOutQty: '可出库数量',
+  project: '项目',
+  summary: '描述',
+  operate: '操作',
 }
 
 /**
@@ -801,6 +813,11 @@ export const messages = {
   W_127: '当前订单没有可退货的数量',
   W_128: '当前订单已全部出库',
   W_129: '删除唯一有价格的商品后重新计算价格',
+  W_130: '当前单据为已出库状态,不可进行作废',
+  W_131: '普通商品{param}不允许为0',
+  W_132: '普通商品输入的{param1}不能大于{param2},请重新输入',
+  W_133: '外协商品{param}不允许为0',
+  W_134: '外协商品输入的{param1}不能大于{param2},请重新输入',
 
   E_001: '系统出现异常,请联系管理员。',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
@@ -1011,6 +1028,10 @@ export const others = {
   followStaffName: '跟进人',
   reportStaffName: '报备人',
   lastFollowTime: '最后跟进时间',
+  orderBy: '排序',
+  'org-rank': '部门利润排行',
+  'staff-rank': '业务员利润排行',
+  'sku-rank': '商品利润排行',
 }
 
 

+ 10 - 8
src/mixins/index.js

@@ -134,14 +134,16 @@ export const indexMixin = {
       if (isMustChooseFlag && name.indexOf('add') < 0 && name !== 'search' && name !== 'clear') {
         // 新建不用校验
         if (!chooseKeys || chooseKeys.length === 0) {
-          // 查看当前行是否有数据
-          let rows = this.$refs[tableRef].getCurrentRow();
-          if (!rows) {
-            this.$Message.warning(this.$t('W_013'))
-            return;
-          } else {
-            chooseKeys = [rows[this.$refs[tableRef]._props.primaryKey]]
-            chooseRows = [rows];
+          if(this.$refs[tableRef]){
+            // 查看当前行是否有数据
+            let rows = this.$refs[tableRef].getCurrentRow();
+            if (!rows) {
+              this.$Message.warning(this.$t('W_013'))
+              return;
+            } else {
+              chooseKeys = [rows[this.$refs[tableRef]._props.primaryKey]]
+              chooseRows = [rows];
+            }
           }
         }
       }

+ 10 - 0
src/router/routers.js

@@ -78,6 +78,16 @@ let menu = [
         },
         component: () => import('@/view/report/custom-report/report.vue')
       },
+      {
+        path: '/single-page/home/beginners-guide',
+        name: 'beginners-guide',
+        meta: {
+          title: '新手指导',
+          hideInMenu: true,
+          notCache: false
+        },
+        component: () => import('@/view/single-page/home/beginners-guide.vue')
+      },
     ]
   },
   // {

+ 72 - 0
src/view/fin/profit-report/detail/org-rank.vue

@@ -0,0 +1,72 @@
+<template>
+  <div>
+    <Spin size="large" v-if="loading" fix ></Spin>
+    <div style="z-index: 10;display: flex;height: 50px;width: 565px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <Modal
+        v-model="btDataShow"
+        title="自定义时间区间">
+        <DatePicker type="daterange" v-model="btDate" placeholder="请选择" style="width: 100%" confirm @on-ok="btOk"></DatePicker>
+        <div slot="footer"></div>
+      </Modal>
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="date" :clearable="false"
+                  placement="bottom-start" type="month" :format="format" :options="dateOption" placeholder="Select date"
+                  style="width: 60%"></DatePicker>
+      <SelectPop v-model="orderBy" ref="orderBy" :multiple="false" style="width:40%;margin-left: 10px"
+                 :options="orderByList"
+                 labelKey="text"
+                 valueKey="value"
+                 @on-select="getSaleProfit"
+      >
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getSaleProfit()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+
+    <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import { mixin } from '@/view/fin/profit-report/mixin'
+
+export default {
+  mixins:[mixin],
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+      tab1Columns: [
+        { name: 'orgName', title: '门店名称', width: '50%' },
+        { name: 'profit', title: '销售利润', type: 'amount', width: '30%' },
+        { name: 'profitRate', title: '利润率', width: '20%', after: '%' },
+      ],
+      tab1TopData: [],
+      tab1TableData: [],
+    }
+  },
+  methods:{
+    getSaleProfit(){
+      this.loading = true
+      let param = this.getDateBetween(this.date)
+      param.orderBy = this.orderBy
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getSaleProfitGroupByOrg, param).then(res => {
+        if (res.code == 200) {
+          this.tab1TopData = [{ title: '销售利润(总额)', type: 'amount', value: res.data.profit ? res.data.profit.profit : 0 },
+            { title: '利润率', type: '', value: (res.data.profit ? res.data.profit.profitRate : 0) + '%' }
+          ]
+          this.tab1TableData = res.data.orgProfit
+        } else{
+          this.$Message.warning(res.message)
+        }
+        this.loading = false
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 72 - 0
src/view/fin/profit-report/detail/sku-rank.vue

@@ -0,0 +1,72 @@
+<template>
+  <div>
+    <Spin size="large" v-if="loading" fix ></Spin>
+    <div style="z-index: 10;display: flex;height: 50px;width: 565px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <Modal
+        v-model="btDataShow"
+        title="自定义时间区间">
+        <DatePicker type="daterange" v-model="btDate" placeholder="请选择" style="width: 100%" confirm @on-ok="btOk"></DatePicker>
+        <div slot="footer"></div>
+      </Modal>
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="date" :clearable="false"
+                  placement="bottom-start" type="month" :format="format" :options="dateOption" placeholder="Select date"
+                  style="width: 60%"></DatePicker>
+      <SelectPop v-model="orderBy" ref="orderBy" :multiple="false" style="width:40%;margin-left: 10px"
+                 :options="orderByList"
+                 labelKey="text"
+                 valueKey="value"
+                 @on-select="getSaleProfit"
+      >
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getSaleProfit()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+
+    <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import { mixin } from '@/view/fin/profit-report/mixin'
+
+export default {
+  mixins:[mixin],
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+      tab1Columns: [
+        { name: 'skuName', title: '商品型号/名称', width: '50%' },
+        { name: 'profit', title: '销售利润', type: 'amount', width: '30%' },
+        { name: 'profitRate', title: '利润率', width: '20%', after: '%' },
+      ],
+      tab1TopData: [],
+      tab1TableData: [],
+    }
+  },
+  methods:{
+    getSaleProfit(){
+      this.loading = true
+      let param = this.getDateBetween(this.date)
+      param.orderBy = this.orderBy
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getSaleProfitGroupBySku, param).then(res => {
+        if (res.code == 200) {
+          this.tab1TopData = [{ title: '销售利润(总额)', type: 'amount', value: res.data.profit ? res.data.profit.profit : 0 },
+            { title: '利润率', type: '', value: (res.data.profit ? res.data.profit.profitRate : 0) + '%' }
+          ]
+          this.tab1TableData = res.data.skuProfit
+        } else{
+          this.$Message.warning(res.message)
+        }
+        this.loading = false
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 94 - 0
src/view/fin/profit-report/detail/staff-rank.vue

@@ -0,0 +1,94 @@
+<template>
+  <div>
+    <Spin size="large" v-if="loading" fix ></Spin>
+    <div style="z-index: 10;display: flex;height: 50px;width: 565px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <Modal
+        v-model="btDataShow"
+        title="自定义时间区间">
+        <DatePicker type="daterange" v-model="btDate" placeholder="请选择" style="width: 100%" confirm @on-ok="btOk"></DatePicker>
+        <div slot="footer"></div>
+      </Modal>
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="date" :clearable="false"
+                  placement="bottom-start" type="month" :format="format" :options="dateOption" placeholder="Select date"
+                  style="width: 50%"></DatePicker>
+      <SelectPop v-model="orgIds" ref="orderBy" :multiple="true" style="width:35%;margin-left: 16px"
+                 :options="orgList"
+                 labelKey="orgName"
+                 valueKey="orgId"
+                 @on-select="getSaleProfit"
+                 :title="$t('orgId')"
+      />
+      <SelectPop v-model="orderBy" ref="orderBy" :multiple="false" style="width:35%;"
+                 :options="orderByList"
+                 labelKey="text"
+                 valueKey="value"
+                 @on-select="getSaleProfit"
+                 :title="$t('orderBy')"
+      />
+      <Button style="width: 50px" size="small"  type="success" @click="getSaleProfit()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+
+    <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import { mixin } from '@/view/fin/profit-report/mixin'
+
+export default {
+  mixins:[mixin],
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+      orgIds: null,
+      orgList: [],
+      tab1Columns: [
+        { name: 'staffName', title: '员工名称', width: '50%' },
+        { name: 'profit', title: '销售利润', type: 'amount', width: '30%' },
+        { name: 'profitRate', title: '利润率', width: '20%', after: '%' },
+      ],
+      tab1TopData: [],
+      tab1TableData: [],
+    }
+  },
+  methods:{
+    getOrgList(){
+      this.excute(this.$service.orgService, this.$service.orgService.selectByCond, {
+        flgValid: true
+      }).then(res=>{
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.orgList=res.data.list
+        }
+      })
+    },
+    getSaleProfit(){
+      this.loading = true
+      let param = this.getDateBetween(this.date)
+      param.orderBy = this.orderBy
+      param.orgIds = this.orgIds
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getSaleProfitGroupByStaff, param).then(res => {
+        if (res.code == 200) {
+          this.tab1TopData = [{ title: '销售利润(总额)', type: 'amount', value: res.data.profit ? res.data.profit.profit : 0 },
+            { title: '利润率', type: '', value: (res.data.profit ? res.data.profit.profitRate : 0) + '%' }
+          ]
+          this.tab1TableData = res.data.staffProfit
+        } else{
+          this.$Message.warning(res.message)
+        }
+        this.loading = false
+      })
+    }
+  },
+  created() {
+    this.getOrgList()
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 541 - 0
src/view/fin/profit-report/index.vue

@@ -0,0 +1,541 @@
+<template>
+  <div style="height: 100%; padding: 5px; max-width: 100%">
+    <Modal
+      v-model="btDataShow"
+      title="自定义时间区间">
+      <DatePicker type="daterange" v-model="btDate" placeholder="请选择" style="width: 100%" confirm
+                  @on-ok="btOk"></DatePicker>
+      <div slot="footer"></div>
+    </Modal>
+    <Row style="height: 50%;">
+      <Col :span="8">
+        <Card style="height: 100%;margin: 2px">
+          <Spin size="large" v-if="loading" fix ></Spin>
+          <div>
+            <div class="top-card" style="font-size: unset">
+              <DatePicker ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="date"
+                          :clearable="false"
+                          placement="bottom-start" type="month" :format="format" :options="dateOption"
+                          placeholder="Select date" style="width: 100%;"></DatePicker>
+            </div>
+
+            <div class="top-card">
+              <div class="top-card-title">销售利润</div>
+              <div class="top-card-icon">
+                <Poptip trigger="hover" content="销售利润=收入-成本">
+                  <Icon type="ios-help-circle-outline" size="20"/>
+                </Poptip>
+              </div>
+              <div class="top-card-money">
+                <span class="top-card-money-num">¥{{ toFixAndToLocaleString(profit.profit || 0) }}</span>
+              </div>
+              <div style="clear: both;"/>
+            </div>
+
+            <div class="top-card">
+              <div class="top-card-title">销售利润率</div>
+              <div class="top-card-icon">
+                <Poptip trigger="hover" content="销售利润率=(收入-成本)/收入×100%">
+                  <Icon type="ios-help-circle-outline" size="20"/>
+                </Poptip>
+              </div>
+              <div class="top-card-percent">{{ profit.profitRate || 0 }}%</div>
+              <div style="clear: both;"/>
+            </div>
+
+            <div class="top-card">
+              <div class="top-card-bottom-text">
+                <div class="top-card-bottom-text-title">销售总额</div>
+                <span class="top-card-bottom-text-num">¥{{ toFixAndToLocaleString(profit.outbound || 0) }}</span>
+                <div style="clear: both;"/>
+              </div>
+            </div>
+            <div class="top-card">
+              <div class="top-card-bottom-text">
+                <div class="top-card-bottom-text-title">成本总额</div>
+                <span class="top-card-bottom-text-num">¥{{ toFixAndToLocaleString(profit.inbound || 0) }}</span>
+                <div style="clear: both;"/>
+              </div>
+            </div>
+          </div>
+        </Card>
+      </Col>
+      <Col :span="16" class="card-view2">
+        <Card style="height: 100%;margin: 2px">
+          <Spin size="large" v-if="loading" fix ></Spin>
+          <div style="height: 100%;">
+            <div class="card-view-header2">
+              <div class="card-view-header-name2">
+                销售毛利
+                <span class="card-view-header-name3" v-if="byDate=='true'">(近一月)</span>
+                <span class="card-view-header-name3" v-else>(近一年)</span>
+              </div>
+              <div>
+                <DkButton color="#f0f0f0" @click="clickProfitDate('true')"
+                          :style="'margin-right: 10px;' + (byDate=='true'?'color: #5c91ce; border: 1px solid #5c91ce':'color: black')">
+                  按日
+                </DkButton>
+                <DkButton color="#ecf1fa" @click="clickProfitDate('false')"
+                          :style="!byDate || byDate=='false'?'color: #5c91ce; border: 1px solid #5c91ce':'color: black'">
+                  按月
+                </DkButton>
+              </div>
+            </div>
+
+            <div style="height: 100%" id="echartsProfitDate"/>
+          </div>
+        </Card>
+      </Col>
+    </Row>
+
+    <Row style="height: 50%;">
+      <Col :span="8" class="card-view2">
+        <Card style="height: 100%;margin: 2px">
+          <Spin size="large" v-if="loading" fix ></Spin>
+          <div class="card-view-header">
+            <div class="card-view-header-name">
+              部门利润排行
+            </div>
+            <div>
+              <Button class="card-view-header-tags-tag" ghost type="text" @click="toDetail('org-rank')">详情
+                <Icon type="ios-arrow-forward"/>
+              </Button>
+            </div>
+          </div>
+          <div style="height: 80%;" id="echartsProfitOrg"/>
+        </Card>
+      </Col>
+      <Col :span="8" class="card-view2">
+        <Card style="height: 100%;margin: 2px">
+          <Spin size="large" v-if="loading" fix ></Spin>
+          <div class="card-view-header">
+            <div class="card-view-header-name">
+              业务员利润排行
+            </div>
+            <div>
+              <Button class="card-view-header-tags-tag" ghost type="text" @click="toDetail('staff-rank')">详情
+                <Icon type="ios-arrow-forward"/>
+              </Button>
+            </div>
+          </div>
+          <div style="height: 80%;" id="echartsProfitStaff"/>
+        </Card>
+      </Col>
+      <Col :span="8" class="card-view2">
+        <Card style="height: 100%;margin: 2px">
+          <Spin size="large" v-if="loading" fix ></Spin>
+          <div class="card-view-header">
+            <div class="card-view-header-name">
+              商品利润排行
+            </div>
+            <div>
+              <Button class="card-view-header-tags-tag" ghost type="text" @click="toDetail('sku-rank')">详情
+                <Icon type="ios-arrow-forward"/>
+              </Button>
+            </div>
+          </div>
+          <div style="height: 80%;" id="echartsProfitSku"/>
+        </Card>
+      </Col>
+    </Row>
+
+    <Drawer :title="detailTitle" width="600" :closable="false" v-model="detailFlag">
+      <OrgRank v-show="type === 'org-rank'" ref="org-rank"/>
+      <StaffRank v-show="type === 'staff-rank'" ref="staff-rank"/>
+      <SkuRank v-show="type === 'sku-rank'" ref="sku-rank"/>
+    </Drawer>
+  </div>
+</template>
+
+<script>
+import OrgRank from '@/view/fin/profit-report/detail/org-rank'
+import StaffRank from '@/view/fin/profit-report/detail/staff-rank'
+import SkuRank from '@/view/fin/profit-report/detail/sku-rank'
+
+import { mixin } from '@/view/fin/profit-report/mixin'
+
+export default {
+  name: 'profit-report',
+  mixins: [mixin],
+  components: {
+    OrgRank, StaffRank, SkuRank
+  },
+  data() {
+    let _self = this
+    return {
+      profit: {},
+      byDate: 'false',
+      //销售毛利
+      options: {
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross',
+            crossStyle: {
+              color: '#999'
+            }
+          }
+        },
+        legend: {
+          data: ['销售毛利', '销售毛利率'],
+          left: '0%',
+        },
+        xAxis: [
+          {
+            type: 'category',
+            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+            axisPointer: {
+              type: 'shadow'
+            }
+          }
+        ],
+        yAxis: [
+          {
+            type: 'value',
+            name: '销售毛利',
+            axisLabel: {
+              formatter: '¥{value}'
+            }
+          },
+          {
+            type: 'value',
+            name: '销售毛利率',
+            axisLabel: {
+              formatter: '{value}%'
+            }
+          }
+        ],
+        series: [
+          {
+            name: '销售毛利',
+            type: 'bar',
+            color: '#41be92',
+            tooltip: {
+              valueFormatter: function (value) {
+                return '¥' + _self.toFixAndToLocaleString(value)
+              }
+            },
+            data: []
+          },
+          {
+            name: '销售毛利率',
+            type: 'line',
+            color: '#efc25b',
+            yAxisIndex: 1,
+            tooltip: {
+              valueFormatter: function (value) {
+                return value + '%'
+              }
+            },
+            data: []
+          }
+        ]
+      },
+      //利润排行
+      options2: {
+        grid: {
+          left: '1%',
+          // top: '0%',
+          // height: '100%',
+          width: '85%',
+          // y: '-7%',
+        },
+        xAxis: {
+          axisTick: {
+            show: false,
+          },
+          axisLine: {
+            show: false,
+          },
+          axisLabel: {
+            show: false,
+          },
+          splitLine: {
+            show: false
+          }
+        },
+        yAxis: [
+          {
+            type: 'category',
+            inverse: true,
+            axisLabel: {
+              verticalAlign: 'bottom',
+              align: 'left',
+              padding: [0, 20, 8, 10],
+              textStyle: {
+                fontSize: 14,
+                color: '#1B365D',
+              }
+            },
+            data: [],
+            yAxisIndex: 0,
+            axisTick: {
+              show: false,
+            },
+            axisLine: {
+              show: false,
+            },
+          },
+          {
+            type: 'category',
+            inverse: true,
+            axisTick: 'none',
+            axisLine: 'none',
+            show: true,
+            axisLabel: {
+              textStyle: {
+                color: '#95A8CB',
+                fontSize: '14'
+              },
+              formatter: (value) => {
+                return '¥ ' + _self.toFixAndToLocaleString(value)
+              },
+            },
+            data: []
+          },
+        ],
+        series: [
+          {
+            showBackground: true,
+            backgroundStyle: {
+              color: '#f1f4f9',
+              barBorderRadius: 6,
+            },
+            barWidth: '10px',
+            itemStyle: {
+              color: {
+                type: 'linear',
+                x: 0,
+                y: 0,
+                x2: 1,
+                y2: 1,
+                colorStops: [{
+                  offset: 0, color: '#85a0f8'
+                }],
+                global: false
+              },
+              barBorderRadius: 8,
+            },
+            data: [],
+            type: 'bar'
+          }
+        ]
+      },
+      detailFlag: false,
+      detailTitle: '',
+      type: null,
+    }
+  },
+  methods: {
+    /**
+     * @desc   : 去详细
+     * @author : 洪旭东
+     * @date   : 2024-06-18 11:44
+     */
+    toDetail(type) {
+      this.detailTitle = this.$t(type)
+      this.detailFlag = true
+      this.type = type
+      this.$refs[type].date = this.date
+      this.$refs[type].dateType = this.dateType
+      this.$refs[type].format = this.format
+      this.$refs[type].getSaleProfit()
+    },
+    /**
+     * @desc   : 点击销售毛利日期条件
+     * @author : 洪旭东
+     * @date   : 2024-06-18 10:27
+     */
+    clickProfitDate(val) {
+      this.byDate = val
+      this.getSaleProfit()
+    },
+    /**
+     * @desc   : 查询数据
+     * @author : 洪旭东
+     * @date   : 2024-06-18 09:06
+     */
+    getSaleProfit() {
+      this.loading = true
+      let param = Object.assign({
+        byDate: this.byDate
+      }, this.getDateBetween(this.date))
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getSaleProfit, param).then(res => {
+        if (res.code == 200) {
+          this.profit = res.data.profit || {}
+
+          let echarts = require('echarts')
+          let chart = echarts.init(document.getElementById('echartsProfitDate'))
+          let options = this.options
+          options.xAxis[0].data = res.data.dateProfit.map(it => it.accDate)
+          options.series[0].data = res.data.dateProfit.map(it => it.profit)
+          options.series[1].data = res.data.dateProfit.map(it => it.profitRate)
+          chart.setOption(options)
+
+          let echarts2 = require('echarts')
+          let chart2 = echarts2.init(document.getElementById('echartsProfitOrg'))
+          let options2 = this.options2
+          options2.yAxis[0].data = res.data.orgProfit.map(it => it.orgName)
+          options2.yAxis[1].data = res.data.orgProfit.map(it => it.profit)
+          options2.series[0].data = res.data.orgProfit.map(it => it.profit)
+          chart2.setOption(options2)
+
+          let echarts3 = require('echarts')
+          let chart3 = echarts3.init(document.getElementById('echartsProfitStaff'))
+          let options3 = this.options2
+          options3.yAxis[0].data = res.data.staffProfit.map(it => it.staffName)
+          options3.yAxis[1].data = res.data.staffProfit.map(it => it.profit)
+          options3.series[0].data = res.data.staffProfit.map(it => it.profit)
+          chart3.setOption(options3)
+
+          let echarts4 = require('echarts')
+          let chart4 = echarts4.init(document.getElementById('echartsProfitSku'))
+          let options4 = this.options2
+          options4.yAxis[0].data = res.data.skuProfit.map(it => it.skuName)
+          options4.yAxis[1].data = res.data.skuProfit.map(it => it.profit)
+          options4.series[0].data = res.data.skuProfit.map(it => it.profit)
+          chart4.setOption(options4)
+
+        } else{
+          this.$Message.warning(res.message)
+        }
+        this.loading = false
+      })
+    },
+    /**
+     * @desc   : 销毁实例
+     * @author : 洪旭东
+     * @date   : 2024-06-20 09:19
+     */
+    dispose(id) {
+      let echarts = require('echarts')
+      if (echarts && document.getElementById(id)) {
+        let chart = echarts.getInstanceByDom(document.getElementById(id))
+        if (chart) chart.dispose()
+      }
+    },
+    toFixAndToLocaleString(number){
+      if(!number){
+        return '0.00'
+      }
+      let arr = number.toString().split('.')
+      if(arr.length>1){
+        return parseInt(arr[0]).toLocaleString()+(parseFloat('.'+arr[1]).toFixed(2).slice(1,4))
+      }else{
+        return parseInt(arr[0]).toLocaleString()+'.00'
+      }
+    },
+  },
+  created() {
+    this.getSaleProfit()
+  },
+  /**
+   * @desc   : 销毁图表
+   * @author : 洪旭东
+   * @date   : 2024-06-20 16:46
+   */
+  beforeDestroy() {
+    this.dispose('echartsProfitDate')
+    this.dispose('echartsProfitOrg')
+    this.dispose('echartsProfitStaff')
+    this.dispose('echartsProfitSku')
+  }
+}
+</script>
+
+<style scoped>
+.top-card {
+  height: 80px;
+  line-height: 50px;
+  font-size: 22px;
+}
+
+.top-card-title {
+  color: red;
+  font-weight: bold;
+  float: left;
+}
+
+.top-card-icon {
+  float: left;
+  margin-left: 40px;
+  height: 100%;
+}
+
+.top-card-money {
+  float: right;
+}
+
+.top-card-money-num {
+  color: #caa977;
+  font-weight: bold;
+  font-size: 22px;
+}
+
+.top-card-percent {
+  float: right;
+  color: #002340;
+}
+
+.top-card-bottom-text {
+  color: #95a8cb;
+}
+
+.top-card-bottom-text-title {
+  float: left;
+}
+
+.top-card-bottom-text-num {
+  float: right;
+}
+
+.card-view2 {
+  height: 100%;
+}
+
+.card-view2 /deep/ .ivu-card-body {
+  height: 100%;
+}
+
+.card-view-header {
+  display: flex;
+  background: linear-gradient(90deg, #deeaff 0%, #FAFEFF 100%);
+  padding: 24px;
+  border-radius: 15px 15px 0px 0px;
+  align-items: center;
+  justify-content: space-between;
+  height: 20%;
+}
+
+.card-view-header2 {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.card-view-header-name {
+  font-weight: bolder;
+  font-size: 18px;
+  color: #1B365D;
+}
+
+.card-view-header-name2 {
+  font-style: normal;
+  font-size: 16px;
+  color: black;
+  font-weight: bolder;
+  display: flex;
+  align-items: center;
+}
+
+.card-view-header-name3 {
+  font-size: 14px;
+  color: #c7c7c7;
+}
+
+.card-view-header-tags-tag {
+  color: #95a8cb;
+  font-weight: 400;
+  font-size: 16px !important;
+}
+</style>

+ 138 - 0
src/view/fin/profit-report/mixin.js

@@ -0,0 +1,138 @@
+export const mixin = {
+  data() {
+    let _self = this
+    return {
+      loading: false,
+      date:new Date(),
+      dateType:3,
+      format:'本月',
+      dateOption: {
+        shortcuts: [
+          {
+            text: '本日',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本日'
+              _self.dateType = 1
+              _self.getSaleProfit()
+            }
+          },
+          {
+            text: '本周',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本周'
+              _self.dateType = 2
+              _self.getSaleProfit()
+            }
+          },
+          {
+            text: '本月',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本月'
+              _self.dateType = 3
+              _self.getSaleProfit()
+
+            }
+          },
+          {
+            text: '本年',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本年'
+              _self.dateType = 5
+              _self.getSaleProfit()
+            }
+          },
+          {
+            text: '区间',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              // _self.format = '区间'
+              _self.dateType = 6
+              _self.btDataShow = true
+              // _self.getSaleProfit()
+            }
+          }
+        ]
+      },
+      btDate:[],
+      btDataShow:false,
+      orderBy: null,
+      orderByList:[
+        {
+          "text": "利润升序",
+          "value": "profitAsc"
+        },
+        {
+          "text": "利润倒序",
+          "value": "profitDesc"
+        },
+        {
+          "text": "利率升序",
+          "value": "rateAsc"
+        },
+        {
+          "text": "利率倒序",
+          "value": "rateDsc"
+        },
+      ],
+    }
+  },
+  methods: {
+    /**
+     * @desc   : 选择日期
+     * @author : 洪旭东
+     * @date   : 2024-06-18 13:49
+     */
+    onChangeDate(){
+      this.format = 'yyyy年MM月'
+      this.dateType = 0
+      this.getSaleProfit()
+    },
+    /**
+     * @desc   : 选择区间
+     * @author : 洪旭东
+     * @date   : 2024-06-18 14:54
+     */
+    btOk(){
+      this.format = '区间:'+this.btDate[0].format('yyyy-MM-dd') + '-' + this.btDate[1].format('yyyy-MM-dd')
+      this.btDataShow = false
+      this.getSaleProfit()
+    },
+    /**
+     * @desc   : 查询日期区间
+     * @author : 洪旭东
+     * @date   : 2024-06-18 14:49
+     */
+    getDateBetween(date){
+      const now = new Date();
+      if (this.dateType === 1){
+        return {makeTimeStart: now.format('yyyy-MM-dd'),makeTimeEnd: now.format('yyyy-MM-dd')}
+      } else if (this.dateType === 2){
+        // 本周
+        const startOfWeek = new Date(now.getFullYear(), now.getMonth(), now.getDate() - now.getDay() + 1)
+        const endOfWeek = new Date(startOfWeek.getFullYear(), startOfWeek.getMonth(), startOfWeek.getDate() + 6)
+        return {makeTimeStart: startOfWeek.format('yyyy-MM-dd'), makeTimeEnd: endOfWeek.format('yyyy-MM-dd')}
+      } else if (this.dateType === 3){
+        // 本月
+        const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1)
+        const endOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0)
+        return {makeTimeStart: startOfMonth.format('yyyy-MM-dd'), makeTimeEnd: endOfMonth.format('yyyy-MM-dd')}
+      } else if (this.dateType === 5){
+        // 本年
+        const startOfYear = new Date(now.getFullYear(), 0, 1)
+        const endOfYear = new Date(now.getFullYear() + 1, 0, 0)
+        return {makeTimeStart: startOfYear.format('yyyy-MM-dd'), makeTimeEnd: endOfYear.format('yyyy-MM-dd')}
+      } else if(this.dateType === 6){
+        return {makeTimeStart: this.btDate[0].format('yyyy-MM-dd'),makeTimeEnd: this.btDate[1].format('yyyy-MM-dd')}
+      } else {
+        let year = date.getFullYear();
+        let month = date.getMonth() + 1;
+        let yearAndMonth = year + '-' + (month>=10?month:'0'+month);
+        return { makeTimeStart:yearAndMonth+'-01',makeTimeEnd:yearAndMonth +'-'+ new Date(year,month,0).getDate()}
+      }
+    },
+  }
+}

+ 2 - 0
src/view/mst/print-layout/layout-setting.vue

@@ -802,6 +802,8 @@ export default {
       console.log('HIPRINT_CONFIG',window.HIPRINT_CONFIG )
       console.log('table',window.HIPRINT_CONFIG.table )
       console.log('hiprintTemplate',this.hiprintTemplate )
+      console.log('hinnn',hinnn )
+      console.log('hiprint',hiprint )
 
       // {
       //   options: {

+ 1 - 1
src/view/mst/supplier/index.vue

@@ -152,7 +152,7 @@ export default {
         supType: null,
         serviceCategories: null,
         brandIds: [],
-        brandNames:[],
+        brandNames:null,
         remarks: null,
         orgId : self.$store.state.user.orgId,
         orgName  : self.$store.state.user.orgName,

+ 68 - 25
src/view/sale/order-out/form.vue

@@ -54,27 +54,27 @@
             <InputPop :telephone="true" ref="contactPhone" :readonly="checkColumnIsEdit('contactPhone')"
                       v-model="formData.contactPhone" :disabled="checkColumnIsEdit('contactPhone')"/>
           </DkFormItem>
-          <!--业务部门-->
-          <DkFormItem prop="orgId" :required="true">
-            <MultiSelect v-model="formData.orgList"
-                         ref="org"
-                         main-field="ownerFlag"
-                         rate-field="allocationRatio"
-                         :order-id="formData.orderId"
-                         :default-value="formData.orgName"
-                         @ok="orgOk($event)"
-                         :type="this.$config.MagnifierType.org"/>
-          </DkFormItem>
-          <!--业务员-->
-          <DkFormItem prop="staffId" :required="true">
-            <MultiSelect v-model="formData.staffList"
-                         main-field="ownerFlag"
-                         rate-field="allocationRatio"
-                         :order-id="formData.orderId"
-                         :default-value="formData.staffName"
-                         @ok="staffOk($event)"
-                         :type="this.$config.MagnifierType.staff"/>
-          </DkFormItem>
+<!--          &lt;!&ndash;业务部门&ndash;&gt;-->
+<!--          <DkFormItem prop="orgId" :required="true">-->
+<!--            <MultiSelect v-model="formData.orgList"-->
+<!--                         ref="org"-->
+<!--                         main-field="ownerFlag"-->
+<!--                         rate-field="allocationRatio"-->
+<!--                         :order-id="formData.orderId"-->
+<!--                         :default-value="formData.orgName"-->
+<!--                         @ok="orgOk($event)"-->
+<!--                         :type="this.$config.MagnifierType.org"/>-->
+<!--          </DkFormItem>-->
+<!--          &lt;!&ndash;业务员&ndash;&gt;-->
+<!--          <DkFormItem prop="staffId" :required="true">-->
+<!--            <MultiSelect v-model="formData.staffList"-->
+<!--                         main-field="ownerFlag"-->
+<!--                         rate-field="allocationRatio"-->
+<!--                         :order-id="formData.orderId"-->
+<!--                         :default-value="formData.staffName"-->
+<!--                         @ok="staffOk($event)"-->
+<!--                         :type="this.$config.MagnifierType.staff"/>-->
+<!--          </DkFormItem>-->
           <!--客户来源-->
           <DkFormItem prop="cusFrom" :required="true">
             <SelectPop v-model="formData.cusFrom" ref="cusFrom" :multiple="false"
@@ -109,6 +109,15 @@
               </i-switch>
             </template>
           </DkFormItem>
+          <!--来源单号-->
+<!--          <DkFormItem prop="fromIdList" :data-type="$config.dataType.array">-->
+<!--          <SelectMagnifier v-model="formData.fromIdList"-->
+<!--                           :input-read-only="false" :multiple="true"-->
+<!--                           :displayText="formData.fromNoList"-->
+<!--                           :type="this.$config.MagnifierType.saleOrderOutFromNo"-->
+<!--                           :disabled="chooseFromNoFlag"-->
+<!--                           @ok="selectFromNoList"/>-->
+<!--        </DkFormItem>-->
           <!--单据备注-->
           <DkFormItem prop="remarks" :span="12">
             <InputPop ref="remarks" v-model="formData.remarks"
@@ -120,6 +129,7 @@
       <DkPanel prop="goodsInformation">
         <div id="search-cond-div-goods-info" ref="search-cond-div-goods-info" slot="content">
           <EditTable ref="goodsTable" :data="formData.itemList" showFooter major-field="itemId"
+                     :addFlag="addAndEditFlag"  @delRow="delTableRow"
                      :columns="addTogetherItemColumns" controlId="skuId" @changeNonStandard="changeNonStandard"
                      @cell-click="handleClickTable" @on-choose="getTotals" @changeValue="getTotals"
           ></EditTable>
@@ -208,6 +218,8 @@ export default {
         outingAmt: null,
         flgAutoHandle: true,
         limitEdit: true,
+        fromIdList:[],//来源单号
+        fromNoList:null,
       },
       addressArea: [],
       cityData: [],
@@ -356,6 +368,8 @@ export default {
         sumOutingQty: 0,
         sumOutingAmt: 0,
       },
+      addAndEditFlag:true,//新建编辑行
+      chooseFromNoFlag:false,//可选来源单号
     }
   },
   methods: {
@@ -565,7 +579,33 @@ export default {
       this.formData.addressFull = null;
       this.setCustomerFlag = false;
     },
-
+    /**
+     *   @desc   : 选择来源单据
+     *   @date   : 2024/6/25 9:53
+     *   @author : 寇珊珊
+     */
+    // selectFromNoList(rows){
+    //   this.addAndEditFlag = false
+    //   console.log("选择来源单据", rows)
+    //   if (rows && rows.length > 0) {
+    //     this.$refs['goodsTable'].tableData = rows
+    //   }
+    //   console.log("this.$refs['goodsTable']", this.$refs['goodsTable'].tableData)
+    // },
+    /**
+     *   @desc   : 删除明细行
+     *   @date   : 2024/6/28 15:12
+     *   @author : 寇珊珊
+     */
+    delTableRow(row){
+      let table  = this.$refs['goodsTable'].getTableDataFilter()
+      if(table && table.length ==0){
+        this.chooseFromNoFlag = false
+        this.addAndEditFlag  = true
+        this.formData.fromNoList  = []
+        this.formData.fromIdList  = []
+      }
+    },
     /**
      * @desc   : 修改包装数
      * @author : 周兴
@@ -583,7 +623,6 @@ export default {
       table[rowIndex]['piece'] = row['nonStandardForm']['piece'] ?row['nonStandardForm']['piece']:0
       this.getTotale(table)
     },
-
     /**
      *   @desc   : 获取商品表格中数量、金额后计算总单信息
      *   @date   : 2022/5/30 15:31
@@ -591,6 +630,12 @@ export default {
      */
     getTotals(field, row, rowIndex) {
       let table = this.$refs['goodsTable'].getTableDataFilter();
+      console.log("this.$refs['goodsTable'].tableData",this.$refs['goodsTable'].tableData )
+      if (this.$refs['goodsTable'].tableData  && this.$refs['goodsTable'].tableData.length > 0) {
+        this.chooseFromNoFlag = true
+      }else{
+        this.chooseFromNoFlag = false
+      }
       this.getTotale(table)
       this.decimalPlaces = row['decimalPlaces']
         if(row['subUnitId']){
@@ -619,7 +664,6 @@ export default {
       row['box'] = row['nonStandardForm']['box']
       row['piece'] = row['nonStandardForm']['piece']
     },
-
     /**
      * @desc   : 计算合计
      * @author : 常皓宁
@@ -641,7 +685,6 @@ export default {
         this.goodsFootFormData.sumOutingAmt = sumOutingAmt;
       }
     },
-
     /**
      * @desc   :表格点击事件
      * @author : 付斌

+ 489 - 56
src/view/sale/order/form.vue

@@ -101,6 +101,10 @@
                            :readonly="checkColumnIsEdit('deliveryDate')"
                            :short-cut-flag="true"/>
           </DkFormItem>
+          <!--开单并出库办理标识-->
+          <DkFormItem prop="outboundProcessingFlag"  v-if="formData.flgAutoHandle">
+            <DkSwitch prop="outboundProcessingFlag" v-model="formData.outboundProcessingFlag" :readonly="type === $config.formMode.edit" ref="outboundProcessingFlag"></DkSwitch>
+          </DkFormItem>
           <!--备注-->
           <DkFormItem prop="remarks" :span="18">
             <InputPop ref="remarks" v-model="formData.remarks"
@@ -111,16 +115,31 @@
       <!--商品信息-->
       <DkPanel prop="goodsInformation">
         <div id="search-cond-div-goods-info" ref="search-cond-div-goods-info" slot="content">
+          <DkTabs v-model="detailModel" :options="detailOptions" @on-click="detailTabsClick"></DkTabs>
+          <!--普通商品-->
+          <div v-show="ordinaryGoodsFlag">
           <EditTable ref="goodsTable" :data="formData.itemList" showFooter major-field="itemId"
                      :new-row-flag="true"
-                     :add-flag="type === $config.formMode.add ? true : false"
-                     :delete-flag="type === $config.formMode.add ? true : false"
+                     :delete-flag="canBigEditFlag"
                      :columns="this.type === this.$config.formMode.add ? addOrderItemColumns: editOrderItemColumns"
                      @changeNonStandard="changeNonStandard"
                      controlId="skuId"
                      @on-choose="getTotals"
                      @changeValue="getTotals"
                      @delRow='delRow'/>
+          </div>
+          <!--外协商品-->
+          <div v-show="outsourcedGoodsFlag">
+            <EditTable ref="outsourcedGoodsTable" :data="formData.outsourcedItemList" showFooter major-field="itemId"
+                       :new-row-flag="true"
+                       :delete-flag="canBigEditFlag"
+                       :columns="this.type === this.$config.formMode.add ? addOutsourcedItemColumns: editOutsourcedItemColumns"
+                       controlId="supId"
+                       @on-choose="getTotalsOutsourced"
+                       @changeValue="getTotalsOutsourced"
+                       @delRow='delRowOutsourced'/>
+          </div>
+          <!--底部总单合计-->
           <div>
             <DkForm ref="goodsFootFormData" v-model="goodsFootFormData" :labelMaxWords="5" name="dk-form"
                     class="read-only-form">
@@ -129,7 +148,7 @@
                 <InputNumberPop ref="sumQuantity" v-model="goodsFootFormData.sumQuantity" :clearable="false"
                                 :digits="2" :readonly="true"/>
               </DkFormItem>
-              <!--货物金额-->
+              <!--合计金额-->
               <DkFormItem prop="sumAmount" class="amount">
                 <InputNumberPop ref="sumAmount" v-model="goodsFootFormData.sumAmount" :clearable="false"
                                 :digits="2" :readonly="true"/>
@@ -198,6 +217,13 @@ export default {
   data() {
     let self = this
     return {
+      detailModel: 'ordinaryGoods',
+      detailOptions: [
+        {label: self.$t('ordinaryGoods'), name: 'ordinaryGoods'}, //普通商品
+        {label: self.$t('outsourcedGoods'), name: 'outsourcedGoods'},//外协商品
+      ],
+      ordinaryGoodsFlag: true,//普通商品标识
+      outsourcedGoodsFlag: false,//外协商品标识
       //小数位数
       decimalPlaces:0,
       formData: {
@@ -231,6 +257,10 @@ export default {
         orgId: self.$store.state.user.orgId,
         orgName: self.$store.state.user.orgName,
         makeStaff: self.$store.state.user.id,
+        outsourcedItemList:[],//外协明细
+        outboundProcessingFlag:true,//开单并出库办理
+        flgAutoHandle : self.$store.state.user.setting[self.$config.settingCode.IVT001] ? true : false ,//自动办理标识
+        flgHandleSetting: self.$store.state.user.setting[self.$config.settingCode.IVT002] ? true : false,//欠货出库标识
       },
       //商品合计信息
       goodsFootFormData: {
@@ -275,10 +305,6 @@ export default {
           searchDetailFlag: true
         },
         {
-          field: 'skuCode',
-          type: 'disabled',
-        },
-        {
           field: 'itemQty',
           type: 'number',
           digits: this.decimalPlaces,
@@ -297,14 +323,14 @@ export default {
           type: 'disabled',
           number: true,
           digits: 2,
-        }, //价
+        }, //
         {
           field: 'itemAmt',
           type: 'disabled',
           digits: 2,
           number: true,
           sum: true,
-        }, //金额
+        }, //售价金额
         {
           field: 'factPrice',
           type: 'number',
@@ -317,7 +343,7 @@ export default {
             //折扣 = 实际单价/ 售价 *100
             discount: ['factPrice / priceSale * 100 ', 'factPrice', 'priceSale'],
           },
-        },//实际价格
+        },//优惠后单价
         {
           field: 'factAmt',
           type: 'number',
@@ -331,7 +357,7 @@ export default {
             //折扣 = 实际金额 / 金额
             discount: ['factAmt /  itemAmt * 100 ', 'factAmt', 'itemAmt'],
           },
-        },//实际金额.
+        },//优惠后金额
         {
           field: 'discount',
           type: 'number',
@@ -446,9 +472,9 @@ export default {
           searchDetailFlag: true
         },
         {
-          field: 'skuCode',
+          field: 'primaryQty',
           type: 'disabled',
-        },
+        }, //可编辑数量
         {
           field: 'itemQty',
           type: 'number',
@@ -468,14 +494,14 @@ export default {
           type: 'disabled',
           number: true,
           digits: 2,
-        }, //价
+        }, //
         {
           field: 'itemAmt',
           type: 'disabled',
           digits: 2,
           number: true,
           sum: true,
-        }, //金额
+        }, //售价金额
         {
           field: 'factPrice',
           type: 'number',
@@ -488,7 +514,7 @@ export default {
             //折扣 = 实际单价/ 售价 *100
             discount: ['factPrice / priceSale * 100 ', 'factPrice', 'priceSale'],
           },
-        },//实际价格
+        },//优惠后单价
         {
           field: 'factAmt',
           type: 'number',
@@ -502,7 +528,7 @@ export default {
             //折扣 = 实际金额 / 金额
             discount: ['factAmt /  itemAmt * 100 ', 'factAmt', 'itemAmt'],
           },
-        },//实际金额.
+        },//优惠后金额.
         {
           field: 'discount',
           type: 'number',
@@ -641,12 +667,262 @@ export default {
           field: 'remarks', type: 'text', equal: true,
         },
       ],
+      addOutsourcedItemColumns:[
+        {
+          field: 'supName',
+          controlId: 'supId',
+          type: 'tableSelect',
+          multiple:false,
+          title:this.$t('supplierName'),
+          otherSearchParam: () => {
+            return {
+              supplierType: self.$config.kindCode.supplierOutsourced,
+            }
+          },
+          width: 200,
+          dataType: self.$config.tableSelectType.supplier,
+          fieldUpdate: self.$updateColumns.saleOrderChooseSupplier,
+          searchDetailFlag: true
+        },
+        {
+          field: 'skuModel',
+          type: 'text',
+          width: 200,
+        },
+        {
+          field: 'skuName',
+          type: 'text',
+          width: 200,
+        },
+        {
+          field: 'itemQty',
+          type: 'number',
+          digits: this.decimalPlaces,
+          sum: true,
+          formula: {
+            itemAmt: ['itemQty*priceSale', 'itemQty', 'priceSale'],
+            factAmt: ['itemQty*factPrice', 'itemQty', 'factPrice'],
+            discount: ['(factPrice / priceSale) * 100 ', 'factPrice', 'priceSale'],
+          },
+        }, //数量
+        {
+          field: 'costPrice',
+          title:this.$t('costPriceSaleOrder'),
+          type: 'number',
+          number: true,
+          digits: 2,
+        }, //成本单价
+        {
+          field: 'priceSale',
+          type: 'number',
+          number: true,
+          digits: 2,
+          formulaLate: true,
+          formula: {
+            //售价 =  金额 *  数量
+            itemAmt: ['priceSale * itemQty  ', 'priceSale', 'itemQty'],
+          },
+        }, //售价
+        {
+          field: 'itemAmt',
+          type: 'number',
+          digits: 2,
+          number: true,
+          sum: true,
+          formulaLate: true,
+          formula: {
+            //售价 =  金额 /  数量
+            priceSale: ['itemAmt / itemQty  ', 'itemAmt', 'itemQty'],
+          },
+        }, //实际金额
+        {
+          field: 'factPrice',
+          type: 'number',
+          digits: 2,
+          formula: {
+            //实际金额 =  数量 *  实际金额
+            factAmt: ['itemQty*factPrice', 'itemQty', 'factPrice'],
+            //标价折扣 =  售价 / 标价 * 100
+            priceDiscount: ['factPrice/priceStd*100', 'factPrice', 'priceStd'],
+            //折扣 = 实际单价/ 售价 *100
+            discount: ['factPrice / priceSale * 100 ', 'factPrice', 'priceSale'],
+          },
+        },//优惠后单价
+        {
+          field: 'factAmt',
+          type: 'number',
+          digits: 2,
+          number: true,
+          sum: true,
+          formulaLate: true,
+          formula: {
+            //实际单价 =  金额 / 数量
+            factPrice: ['factAmt / itemQty  ', 'priceSale', 'discount'],
+            //折扣 = 实际金额 / 金额
+            discount: ['factAmt /  itemAmt * 100 ', 'factAmt', 'itemAmt'],
+          },
+        },//优惠后金额.
+        {
+          field: 'discount',
+          type: 'number',
+          number: true,
+          digits: 0,
+          formulaLate: true,
+          formula: {
+            //实际单价 =  售价 * 折扣 / 100 - 优惠金额
+            factPrice: ['priceSale * discount /100 ', 'priceSale', 'discount'],
+            //实际金额 =  数量 *  实际金额
+            factAmt: ['itemQty * factPrice', 'itemQty', 'factPrice'],
+          },
+        },//折扣
+        {
+          field: 'remarks', type: 'text', equal: true,
+        },
+      ],
+      editOutsourcedItemColumns:[
+        {
+          field: 'supName',
+          controlId: 'supId',
+          type: 'tableSelect',
+          multiple:false,
+          title:this.$t('supplierName'),
+          otherSearchParam: () => {
+            return {
+              supplierType: self.$config.kindCode.supplierOutsourced,
+            }
+          },
+          width: 200,
+          dataType: self.$config.tableSelectType.supplier,
+          fieldUpdate: self.$updateColumns.saleOrderChooseSupplier,
+          searchDetailFlag: true
+        },
+        {
+          field: 'skuModel',
+          type: 'text',
+          width: 200,
+        },
+        {
+          field: 'skuName',
+          type: 'text',
+          width: 200,
+        },
+        {
+          field: 'primaryQty',
+          type: 'disabled',
+        }, //可编辑数量
+        {
+          field: 'itemQty',
+          type: 'number',
+          digits: this.decimalPlaces,
+          sum: true,
+          formula: {
+            itemAmt: ['itemQty*priceSale', 'itemQty', 'priceSale'],
+            factAmt: ['itemQty*factPrice', 'itemQty', 'factPrice'],
+            discount: ['(factPrice / priceSale) * 100 ', 'factPrice', 'priceSale'],
+          },
+        }, //数量
+        {
+          field: 'costPrice',
+          title:this.$t('costPriceSaleOrder'),
+          type: 'number',
+          number: true,
+          digits: 2,
+        }, //成本单价
+        {
+          field: 'priceSale',
+          type: 'number',
+          number: true,
+          digits: 2,
+          formulaLate: true,
+          formula: {
+            //售价 =  金额 *  数量
+            itemAmt: ['priceSale * itemQty  ', 'priceSale', 'itemQty'],
+          },
+        }, //售价
+        {
+          field: 'itemAmt',
+          type: 'number',
+          digits: 2,
+          number: true,
+          sum: true,
+          formulaLate: true,
+          formula: {
+            //售价 =  金额 /  数量
+            priceSale: ['itemAmt / itemQty  ', 'itemAmt', 'itemQty'],
+          },
+        }, //实际金额
+        {
+          field: 'factPrice',
+          type: 'number',
+          digits: 2,
+          formula: {
+            //实际金额 =  数量 *  实际金额
+            factAmt: ['itemQty*factPrice', 'itemQty', 'factPrice'],
+            //标价折扣 =  售价 / 标价 * 100
+            priceDiscount: ['factPrice/priceStd*100', 'factPrice', 'priceStd'],
+            //折扣 = 实际单价/ 售价 *100
+            discount: ['factPrice / priceSale * 100 ', 'factPrice', 'priceSale'],
+          },
+        },//优惠后单价
+        {
+          field: 'factAmt',
+          type: 'number',
+          digits: 2,
+          number: true,
+          sum: true,
+          formulaLate: true,
+          formula: {
+            //实际单价 =  金额 / 数量
+            factPrice: ['factAmt / itemQty  ', 'priceSale', 'discount'],
+            //折扣 = 实际金额 / 金额
+            discount: ['factAmt /  itemAmt * 100 ', 'factAmt', 'itemAmt'],
+          },
+        },//优惠后金额.
+        {
+          field: 'discount',
+          type: 'number',
+          number: true,
+          digits: 0,
+          formulaLate: true,
+          formula: {
+            //实际单价 =  售价 * 折扣 / 100 - 优惠金额
+            factPrice: ['priceSale * discount /100 ', 'priceSale', 'discount'],
+            //实际金额 =  数量 *  实际金额
+            factAmt: ['itemQty * factPrice', 'itemQty', 'factPrice'],
+          },
+        },//折扣
+        {
+          field: 'remarks', type: 'text', equal: true,
+        },
+      ],
       updateTotalFootMessageFlag:false,
+      canBigEditFlag:true,//可以大编辑标识
     }
   },
 
   methods: {
     /**
+     *   @desc   : 点击Tab进行切换
+     *   @date   : 2024/6/18 10:27
+     *   @author : 寇珊珊
+     */
+    detailTabsClick(val) {
+      //普通商品
+      if (val === 'ordinaryGoods') {
+        //普通商品标识
+        this.ordinaryGoodsFlag = true
+        //外协商品标识
+        this.outsourcedGoodsFlag = false
+      }
+      //外协商品
+      else if (val === 'outsourcedGoods') {
+        //普通商品标识
+        this.ordinaryGoodsFlag = false
+        //外协商品标识
+        this.outsourcedGoodsFlag = true
+      }
+    },
+    /**
      * @desc   : 加载数据
      * @author : 付斌
      * @date   : 2024-02-20 15:53
@@ -872,7 +1148,6 @@ export default {
       table[rowIndex]['itemQty'] = row['packBox'] * (row['nonStandardForm']['box']?row['nonStandardForm']['box']:0) + (row['nonStandardForm']['piece'] ?row['nonStandardForm']['piece']:0)
       table[rowIndex]['itemAmt'] = table[rowIndex]['itemQty'] * table[rowIndex]['priceSale']
       table[rowIndex]['factAmt'] = table[rowIndex]['itemQty'] * table[rowIndex]['factPrice']
-      console.log('row',row)
       table[rowIndex]['box'] = row['nonStandardForm']['box']?row['nonStandardForm']['box']:0
       table[rowIndex]['piece'] = row['nonStandardForm']['piece'] ?row['nonStandardForm']['piece']:0
       this.getTotale(table)
@@ -884,10 +1159,9 @@ export default {
      */
     getTotals(field, row, rowIndex) {
       let table = this.$refs['goodsTable'].tableData.filter(it=>it.skuId)
-      console.log('table',JSON.parse(JSON.stringify(table)))
       if (table && table.length > 0) {
         //计算合计
-        this.getTotale(table)
+        this.getTotale()
         table.forEach(row => {
           //数量
           if (!row["itemQty"] || row["itemQty"] == '') {
@@ -944,12 +1218,10 @@ export default {
       let tableLength = this.$refs['goodsTable'].tableData.filter(it => it.skuId && !it.flgGift).length
       //region 有价格
       let hasPriceTable = this.$refs['goodsTable'].tableData.filter(it => it.skuId && it.priceSale > 0 && !it.flgGift)
-      console.log("有价格",hasPriceTable)
       //endregion
 
       //region  无价格
       let noPriceTable = this.$refs['goodsTable'].tableData.filter(it => it.skuId && (!it.priceSale || it.priceSale == 0) && !it.flgGift)
-      console.log("无价格",noPriceTable)
       if (noPriceTable && noPriceTable.length > 0 && noPriceTable.length == tableLength) {
         this.updateTotalFootMessageFlag = true
         for (let i = 0; i < noPriceTable.length; i++) {
@@ -967,6 +1239,39 @@ export default {
       //endregion
     },
     /**
+     *   @desc   : 外协品修改明细行
+     *   @date   : 2024/6/18 15:09
+     *   @author : 寇珊珊
+     */
+    getTotalsOutsourced(field, row, rowIndex){
+      //计算合计
+      this.getTotale()
+      //过滤有商品并且不是赠品数据
+      let tableLength = this.$refs['outsourcedGoodsTable'].tableData.filter(it => it.supId ).length
+      //region 有价格
+      let hasPriceTable = this.$refs['outsourcedGoodsTable'].tableData.filter(it => it.supId && it.priceSale > 0)
+      //endregion
+
+      //region  无价格
+      if(this.$refs['outsourcedGoodsTable'].tableData && this.$refs['outsourcedGoodsTable'].tableData.length>0 ){
+        let noPriceTable = this.$refs['outsourcedGoodsTable'].tableData.filter(it => it.supId && (!it.priceSale || it.priceSale == 0) )
+        if (noPriceTable && noPriceTable.length > 0 && noPriceTable.length == tableLength) {
+          for (let i = 0; i < noPriceTable.length; i++) {
+            //折扣禁用
+            noPriceTable[i].readOnly = ['discount']
+          }
+          this.$refs['outsourcedGoodsTable'].$refs['xTable'].refreshColumn();
+        } else {
+          let delReadOnlyTable = this.$refs['outsourcedGoodsTable'].tableData
+          for (let i = 0; i <delReadOnlyTable.length; i++) {
+            delete delReadOnlyTable[i].readOnly
+          }
+          this.$refs['outsourcedGoodsTable'].$refs['xTable'].refreshColumn();
+        }
+      }
+      //endregion
+    },
+    /**
      *   @desc   : 修改实收金额或者折扣或者优惠金额
      *   @date   : 2024/6/12 11:01
      *   @author : 寇珊珊
@@ -993,7 +1298,7 @@ export default {
         this.goodsFootFormData.discount = parseInt( parseFloat(value).toFixed(2) )
         //实收金额 = 合计金额 * 折扣
         this.goodsFootFormData.factAmt = parseFloat( ( parseFloat(this.goodsFootFormData.sumAmount) * parseFloat(this.goodsFootFormData.discount) /100 ).toFixed(2) )
-        //优惠金额 = 合计金额 - 实收金额
+        //优惠金额 = 合计金额 - 实收金额
         this.goodsFootFormData.discAmt = parseFloat( ( parseFloat(this.goodsFootFormData.sumAmount) -  parseFloat(this.goodsFootFormData.factAmt) ).toFixed(2) )
       }
       //优惠金额
@@ -1007,8 +1312,12 @@ export default {
       }
       //endregion
 
-      //region  修改明细
+      //region  修改普通明细和外协明细
       let table = this.$refs['goodsTable'].tableData.filter(it => it.skuId && it.priceSale > 0 && !it.flgGift)
+      let outsourcedTable = this.$refs['outsourcedGoodsTable'].tableData.filter(it => it.supId)
+      if (outsourcedTable && outsourcedTable.length > 0) {
+        table = table.concat(outsourcedTable)
+      }
       if (table && table.length > 0) {
         let  i = 1;
         let sumFactAmt = 0
@@ -1051,10 +1360,17 @@ export default {
     * @date   : 2024/5/29 13:27
     */
     getTotale(table){
+      if (!table) {
+        table = this.$refs['goodsTable'].tableData.filter(it => it.skuId)
+        let outsourcedTable = this.$refs['outsourcedGoodsTable'].tableData.filter(it => it.supId)
+        if (outsourcedTable && outsourcedTable.length > 0) {
+          table = table.concat(outsourcedTable)
+        }
+      }
       let sumQuantity = 0;  // 合计数量
-      let sumAmount = 0;    // 货物金额
+      let sumAmount = 0;    // 合计金额
       let sumStandard = 0;  // 标价总额
-      let factAmt = 0;  // 实际合计金额
+      let factAmt = 0;  // 折扣金额
       if (table && table.length > 0) {
         table.forEach(row => {
           sumQuantity += parseFloat(row["itemQty"]);
@@ -1105,6 +1421,31 @@ export default {
       }
     },
     /**
+     *   @desc   : 删除外协品明细行
+     *   @date   : 2024/6/12 9:44
+     *   @author : 寇珊珊
+     */
+    delRowOutsourced(row, rowIndex) {
+      let list = this.$refs['outsourcedGoodsTable'].tableData.filter(it => it.supId)
+      if(list && list.length > 0){
+        let table = this.$refs['outsourcedGoodsTable'].tableData.filter(it => it.priceSale > 0)
+        if (table && table.length == 0) {
+          this.$IBMessage({
+              content: this.$t('Q_002', {'param': this.$v('W_129')}),
+              title: this.$t('systemQuestion')
+            },
+            {
+              ok: () => {
+                this.getTotals(this.$refs['outsourcedGoodsTable'].tableData)
+              },
+              cancel: () => {
+                this.$refs['outsourcedGoodsTable'].tableData.push(row);
+              }
+            })
+        }
+      }
+    },
+    /**
      * @desc   : 通过id查询
      * @author : 付斌
      * @date   : 2022/03/04 13:17
@@ -1119,37 +1460,70 @@ export default {
      */
     setValuesByEdit(data) {
       if (data) {
+        // redion 对可大编辑标识赋值
+        if(this.type === this.$config.formMode.edit){
+          //已出库
+          if( data["data"].outStatus == this.$config.outStatus.yiChuKu){
+            this.canBigEditFlag = false
+          }
+          //出库中或未出库
+          else{
+            this.canBigEditFlag = true
+          }
+        }
+        //endregion
+
         this.formData = data["data"];
-        this.formData.itemList = data["dataItem"];
+        if( data["dataItem"] && data["dataItem"].length>0){
+          for(let i =0;i<data["dataItem"].length;i++){
+            //可编辑数量(原数量)
+            data["dataItem"][i].primaryQty =   data["dataItem"][i].itemQty
+          }
+
+          let itemList = data["dataItem"].filter(it=>it.skuId)
+          this.formData.itemList =  itemList
+          this.formData.outsourcedItemList =  data["dataItem"].filter(it=>!it.skuId)
+        }
         this.formData.receiptList = data["receiptItem"];
 
-        let itemList = data["dataItem"];
-        itemList.map(row=>{
-          let item = row
-          //包装规格
-          this.$set(item, 'unitInfo', row['boxPiece'])
-          row.nonStandardForm = {
-            formula: (row['subUnitName']?'1'+row['subUnitName']:'' ) + row['packBox'] + row['unitName'],
-            box:row['box'],
-            piece:row['piece'],
-          }
-          //包装
-          if(row['subUnitId']){
-            row.nonStandardItems = [
-              {code:'formula',label:'计算公式',type:'text',readonly:true},
-              {code:'box',label:row['subUnitName'],type:'number'},
-              {code:'piece',label:row['unitName'],type:'number'}
-            ]
-          }else{
-            row.nonStandardItems = [
-              {code:'formula',label:'计算公式',type:'text',readonly:true},
-              {code:'piece',label:row['unitName'],type:'number',field:'piece'}
-            ]
-          }
-        })
+        if (itemList && itemList.length > 0) {
+          itemList.map(row => {
+            let item = row
+            //包装规格
+            this.$set(item, 'unitInfo', row['boxPiece'])
+            row.nonStandardForm = {
+              formula: (row['subUnitName'] ? '1' + row['subUnitName'] : '') + row['packBox'] + row['unitName'],
+              box: row['box'],
+              piece: row['piece'],
+            }
+            //包装
+            if (row['subUnitId']) {
+              row.nonStandardItems = [
+                {code: 'formula', label: '计算公式', type: 'text', readonly: true},
+                {code: 'box', label: row['subUnitName'], type: 'number'},
+                {code: 'piece', label: row['unitName'], type: 'number'}
+              ]
+            } else {
+              row.nonStandardItems = [
+                {code: 'formula', label: '计算公式', type: 'text', readonly: true},
+                {code: 'piece', label: row['unitName'], type: 'number', field: 'piece'}
+              ]
+            }
+          })
+        }
+        //商品总数
         this.goodsFootFormData.sumQuantity = this.formData.sumQuantity;
+        //合计金额
         this.goodsFootFormData.sumAmount = this.formData.sumAmount;
+        //折扣
+        this.goodsFootFormData.discount = this.formData.discount;
+        //折后金额
+        this.goodsFootFormData.factAmt = this.formData.factAmt;
+        //优惠金额
+        this.goodsFootFormData.discAmt = this.formData.discAmt;
+        //标价
         this.goodsFootFormData.sumStandard = this.formData.sumStandard;
+        //标价折扣
         this.goodsFootFormData.saleDiscount = this.formData.saleDiscount;
       }
     },
@@ -1184,17 +1558,55 @@ export default {
         }
       }
 
+      //普通商品
       let itemTable = this.$refs['goodsTable'].getTableDataFilter();
+      //外协品
+      let outsourcedItemTable = this.$refs['outsourcedGoodsTable'].getTableDataFilter();
+      if(outsourcedItemTable && outsourcedItemTable.length>0){
+        itemTable = itemTable.concat(outsourcedItemTable)
+      }
       if (!itemTable || itemTable.length == 0) {
         this.$Message.warning(this.$t('W_012'))
         return false;
       }
+      let i= 0
       for (let it of itemTable) {
         if (!it.itemQty || it.itemQty === '' || it.itemQty === 0) {
-          this.$Message.warning(this.$t('W_042', {'param': '明细数量不能'}))
+          this.$message.error(this.$t('W_131', {
+            'param': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('itemQty')
+          }))
           return false;
         }
+        //编辑校验数量不能大于 编辑查询时带出来的数量
+        if( this.type === this.$config.formMode.edit ){
+          if(it.itemQty > it.primaryQty){
+            this.$message.error(this.$t('W_132', {'param1': this.$t('itemQty'), 'param2':  this.$t('primaryQty')}))
+            this.$Message.warning(this.$t('W_134'))
+            return false;
+          }
+        }
+        i++
       }
+
+      //外协品列表
+      let index = 0
+      for (let it of outsourcedItemTable) {
+        if (!it.itemQty || it.itemQty === '' || it.itemQty === 0) {
+          this.$message.error(this.$t('W_133', {
+            'param': this.$t('sequence') + (index + 1) + this.$t('rowNo') + this.$t('itemQty')
+          }))
+          return false;
+        }
+        //编辑校验数量不能大于 编辑查询时带出来的数量
+        if( this.type === this.$config.formMode.edit ){
+          if(it.itemQty > it.primaryQty){
+            this.$message.error(this.$t('W_134', {'param1': this.$t('itemQty'), 'param2':  this.$t('primaryQty')}))
+            return false;
+          }
+        }
+        index++
+      }
+
       return true;
     },
     /**
@@ -1206,14 +1618,38 @@ export default {
       if (this.type === this.$config.formMode.edit) {
         // 删除的表数据
         let deleteItemTable = this.$refs['goodsTable'].getDeleteData();
-        this.formData.deleteItemList = deleteItemTable
+        //删除的外协数据
+        let deleteOutsourcedItemTable = this.$refs['outsourcedGoodsTable'].getDeleteData();
+        if(deleteOutsourcedItemTable && deleteOutsourcedItemTable.length>0){
+          this.formData.deleteItemList = deleteItemTable.concat(deleteOutsourcedItemTable)
+        }else{
+          this.formData.deleteItemList = deleteItemTable
+        }
       }
+
       // 修改新增的表数据
       let itemTable = this.$refs['goodsTable'].getTableDataFilter();
+      //修改新增的外协品表数据
+      let itemOutsourcedTable = this.$refs['outsourcedGoodsTable'].getTableDataFilter();
+      if(itemOutsourcedTable && itemOutsourcedTable.length>0){
+        itemTable =  itemTable.concat(itemOutsourcedTable)
+      }
       itemTable.forEach((it, index) => {
         if (!it.nonStdCode || it.nonStdCode === '') {
           this.$set(it, 'nonStdCode', '-');
         }
+        //标价
+        if (!it.priceStd || it.priceStd == 0) {
+          this.$set(it, 'priceStd',0);
+        }
+        //标价金额
+        if (!it.amtStd || it.amtStd == 0) {
+          this.$set(it, 'amtStd',0);
+        }
+        //标价折扣
+        if (!it.priceDiscount || it.priceDiscount == 0) {
+          this.$set(it, 'priceDiscount',100);
+        }
       });
       this.formData.itemList = itemTable;
       this.formData.receiptList = this.$refs['receiptTable'].getTableDataFilter();
@@ -1375,9 +1811,6 @@ export default {
    * @date   : 2022/3/3 10:32
    */
   created() {
-    // console.log('this.$route', this.$route)
-    // console.log('this.$store.state.user', this.$store.state.user)
-
     this.focusItem = 'orderId';    // 给第一个组件赋值,可以在混入中自动去聚焦
     this.primaryKey = 'orderId'  // 设置主键Id
   }

+ 11 - 7
src/view/sale/order/index.vue

@@ -8,6 +8,7 @@
         <BaseIndexButton ref="edit" name="edit"></BaseIndexButton>
         <BaseIndexButton ref="orderOut" name="orderOut"></BaseIndexButton>
         <BaseIndexButton ref="orderOutReturn" name="orderOutReturn"></BaseIndexButton>
+        <!--作废-->
         <BaseIndexButton ref="invalid" name="invalid"></BaseIndexButton>
         <!--销售跟踪-->
         <BaseIndexButton ref="orderTrack" name="orderTrack"/>
@@ -51,13 +52,10 @@
             <DkTableColumn field="sumQuantity" dataType="number" sum/>
             <DkTableColumn field="sumStandard" :digits="2" dataType="number" sum/>
             <DkTableColumn field="sumAmount" :digits="2" dataType="number" sum/>
-            <DkTableColumn field="saleDiscount" :digits="2" dataType="number" sum/>
+            <DkTableColumn field="saleDiscount" :digits="2" dataType="number"/>
             <DkTableColumn field="outingQty" dataType="number" sum/>
             <DkTableColumn field="outQty" dataType="number" sum/>
             <DkTableColumn field="returnQty" dataType="number" sum/>
-            <DkTableColumn field="amtReceivable" :digits="2" dataType="number" sum/>
-            <DkTableColumn field="amtHandle" :digits="2" dataType="number" sum/>
-            <DkTableColumn field="amtResidue" :digits="2" dataType="number" sum/>
             <DkTableColumn field="addressFull"></DkTableColumn>
             <DkTableColumn field="deliveryDate" data-type="date"/>
             <DkTableColumn field="orgName"/>
@@ -86,11 +84,11 @@
             <DkTableColumn field="piece" dataType="number" :digits="0"/>
             <!-- 包装数量-->
             <DkTableColumn field="boxPiece" />
-            <DkTableColumn field="priceStd" :digits="2" dataType="number" sum/>
+            <DkTableColumn field="priceStd" :digits="2" dataType="number"/>
             <DkTableColumn field="amtStd" :digits="2" dataType="number" sum/>
-            <DkTableColumn field="priceSale" :digits="2" dataType="number" sum/>
+            <DkTableColumn field="priceSale" :digits="2" dataType="number"/>
             <DkTableColumn field="itemAmt" :digits="2" dataType="number" sum/>
-            <DkTableColumn field="priceDiscount" :digits="2" dataType="number" sum/>
+            <DkTableColumn field="priceDiscount" :digits="2" dataType="number"/>
             <DkTableColumn field="whName"/>
             <DkTableColumn field="outingQty" dataType="number" sum/>
             <DkTableColumn field="outingAmt" :digits="2" dataType="number" sum/>
@@ -324,6 +322,12 @@ export default {
      */
     invalid(rows) {
       if (rows && rows.length > 0) {
+        let row  = rows[0]
+        //已出库不允许作废
+        if(row.outStatus && row.outStatus ==this.$config.outStatus.yiChuKu){
+          this.$Message.success(this.$t('W_130'))
+          return
+        }
         this.$IBMessage({content: this.$t('Q_002', {'param': this.$v('invalid')}), title: this.$t('systemQuestion')},
           {
             ok: () => {

+ 155 - 0
src/view/single-page/home/beginners-guide.vue

@@ -0,0 +1,155 @@
+<!-- @desc:新手指导  @auth:付斌  @time:2024/07/01 09:15 -->
+<template>
+  <div class="main-div">
+    <!--  卡片区  -->
+    <div class="index-card">
+      <div style="display: flex;justify-content: space-between">
+        <div style="width: 90%">
+          <Steps :current="current" style="margin: 20px 0px 20px 0px">
+            <Step title="录入资料" content="录入商品信息是进行店铺管理的第一步,店铺信息的完善是精细化运营的必经之路"></Step>
+            <Step title="开单记账" content="记录单据让每笔交易有迹可循,告别手工记录,数字化管理店铺"></Step>
+            <Step title="分析报表" content="系统自动生成数据报表,数据辅助决策,助力生意增长"></Step>
+          </Steps>
+          <Button type="primary" style="margin: 0px 10px 20px 0px" @click="last">上一步</Button>
+          <Button type="primary" style="margin: 0px 0px 20px 0px" @click="next">下一步</Button>
+          <!--  表格部分  -->
+          <DkTable slot="top" :id="'table-'+$options.name"
+                   ref="table-select" name="table" :data="tableData" primaryKey="project"
+                   :page-flag="false"
+                   :height="this.tableHeight  - 200">
+            <DkTableColumn field="project"/>
+            <DkTableColumn field="summary"/>
+            <DkTableColumn field="operate" :type="'link'" @on-link="linkPage"/>
+          </DkTable>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+
+import {indexMixin} from '@/mixins'
+
+export default {
+  name: 'beginners-guide',
+  mixins: [indexMixin],
+  data() {
+    let self = this
+    return {
+      current: 0,
+      tableData: [],
+    }
+  },
+
+  methods: {
+    /**
+     * @desc   : 上一步
+     * @author : 付斌
+     * @date   : 2024-07-01 9:48
+     */
+    last() {
+      if (this.current == 0) {
+        this.current = 2;
+      } else {
+        this.current -= 1;
+      }
+      this.setTableData();
+    },
+    /**
+     * @desc   : 下一步
+     * @author : 付斌
+     * @date   : 2024-07-01 9:48
+     */
+    next() {
+      if (this.current == 2) {
+        this.current = 0;
+      } else {
+        this.current += 1;
+      }
+      this.setTableData();
+    },
+    /**
+     * @desc   : 设置数据源
+     * @author : 付斌
+     * @date   : 2024-07-01 9:48
+     */
+    setTableData() {
+      if (this.current == 0) {
+        this.tableData = [
+          {"project": "添加商品", "summary": "管理你的商品信息", "operate": "演示教程"},
+          {"project": "添加客户", "summary": "维护你的客户资料", "operate": "演示教程"},
+          {"project": "添加供应商", "summary": "管理你的供应商", "operate": "演示教程"},
+          {"project": "添加员工", "summary": "多人看店不忙碌", "operate": "演示教程"},
+        ]
+      } else if (this.current == 1) {
+        this.tableData = [
+          {"project": "销售单", "summary": "卖一笔记一笔", "operate": "演示教程"},
+          {"project": "进货单", "summary": "记录每次进货", "operate": "演示教程"},
+          {"project": "收款单", "summary": "不忘每笔收款", "operate": "演示教程"},
+          {"project": "付款单", "summary": "记录每单应付款", "operate": "演示教程"},
+        ]
+      } else if (this.current == 2) {
+        this.tableData = [
+          {"project": "利润统计", "summary": "查看店铺利润情况", "operate": "演示教程"},
+          {"project": "销售统计", "summary": "掌握商品销售排名", "operate": "演示教程"},
+          {"project": "库存统计", "summary": "库存清晰不错乱", "operate": "演示教程"},
+        ]
+      }
+    },
+    /**
+     * @desc   : 进入页面
+     * @author : 付斌
+     * @date   : 2024-07-01 10:10
+     */
+    linkPage(row) {
+      console.log("row", row)
+      switch (row.project) {
+        case '添加商品':
+          this.$router.push('/mst/goods/add/')
+          break;
+        case '添加客户':
+          this.$router.push('/mst/customer/add/')
+          break;
+        case '添加供应商':
+          this.$router.push('/mst/supplier/index/')
+          break;
+        case '添加员工':
+          this.$router.push('/mst/staff/index/')
+          break;
+        case '销售单':
+          this.$router.push('/sale/order/add/')
+          break;
+        case '进货单':
+          this.$router.push('/pur/pur-order/add/')
+          break;
+        case '收款单':
+          this.$router.push('/fin/receipt/add/')
+          break;
+        case '付款单':
+          this.$router.push('/fin/payment/add/')
+          break;
+        case '利润统计':
+          this.$router.push('/fin/profit-report/index/')
+          break;
+        case '销售统计':
+          this.$router.push('/report/detail-report/index/order-detail-report')
+          break;
+        case '库存统计':
+          this.$router.push('/report/detail-report/index/ivt-detail-report')
+          break;
+      }
+    },
+  },
+  /**
+   * @desc   : 在实例创建完成后被立即同步调用
+   * @author : 付斌
+   * @date   : 2024-07-01 10:10
+   */
+  created() {
+    this.routeObjName = 'beginnersGuide'  // 设置路由名称
+    this.setTableData()
+  },
+}
+</script>
+

+ 1563 - 1295
src/view/single-page/home/home.vue

@@ -17,9 +17,12 @@
             <div style="display: flex;width: 100%;flex-wrap: wrap;">
               <div v-for="(f2Item,f2Index) in fItem.children" :key="f2Index" :style="{marginTop:f2Index>4?'10px':'0'}"
                    style="position:relative;width: 20%;text-align: center;">
-                <Checkbox @on-change="funcCheckBoxChange($event,f2Item)" :ref="'name-'+f2Item.menuUuid" class="ttt" v-model="f2Item._checked">
+                <Checkbox @on-change="funcCheckBoxChange($event,f2Item)" :ref="'name-'+f2Item.menuUuid" class="ttt"
+                          v-model="f2Item._checked">
                   <div style="width: 40px;height: 40px;position: relative;margin: auto">
-                    <img :src="require('@/assets/images/menu-image/' + (f2Item.meta.icon ? f2Item.meta.icon + '.png':'customer.png') )" style="width: 40px;height: 40px;"/>
+                    <img
+                      :src="require('@/assets/images/menu-image/' + (f2Item.meta.icon ? f2Item.meta.icon + '.png':'customer.png') )"
+                      style="width: 40px;height: 40px;"/>
                   </div>
                   <div class="func-item-title">{{ f2Item.meta.title }}</div>
                 </Checkbox>
@@ -31,12 +34,16 @@
           <div style="height: 56px;display: flex;justify-content: center;align-items: center;">
             <div v-show="rightFuncList.length>0" class="clear-btn" @click="clearAll">全部清空</div>
           </div>
-          <draggable v-if="rightFuncList.length>0" :animation="300" v-model="rightFuncList" style="display: flex;width: 100%;flex-wrap: wrap;">
+          <draggable v-if="rightFuncList.length>0" :animation="300" v-model="rightFuncList"
+                     style="display: flex;width: 100%;flex-wrap: wrap;">
             <div v-for="(rfItem,rfIndex) in rightFuncList" class="draggable-div" :key="rfIndex"
                  style="position:relative;width: 20%;margin-bottom:10px;text-align: center;">
               <div style="width: 40px;height: 40px;position: relative;margin: auto">
-                <img :src="require('@/assets/images/menu-image/' +( rfItem.meta.icon ? rfItem.meta.icon + '.png':'customer.png') )" style="width: 40px;height: 40px;"/>
-                <div @click="funcCheckBoxChangeRight('name-'+rfItem.menuUuid)" style="cursor:pointer;display:flex;justify-content:center;font-size:14px;align-items:center;position: absolute;top: -7px;right: -7px;padding: 2px;background-color: red;border: 1px solid #fff;border-radius: 50%;height: 20px;width:20px;color:#fff;font-weight: bold;">
+                <img
+                  :src="require('@/assets/images/menu-image/' +( rfItem.meta.icon ? rfItem.meta.icon + '.png':'customer.png') )"
+                  style="width: 40px;height: 40px;"/>
+                <div @click="funcCheckBoxChangeRight('name-'+rfItem.menuUuid)"
+                     style="cursor:pointer;display:flex;justify-content:center;font-size:14px;align-items:center;position: absolute;top: -7px;right: -7px;padding: 2px;background-color: red;border: 1px solid #fff;border-radius: 50%;height: 20px;width:20px;color:#fff;font-weight: bold;">
                   <div style="width: 75%;height: 2px;background-color: #fff;"></div>
                 </div>
               </div>
@@ -45,1432 +52,1693 @@
           </draggable>
           <div v-else style="width: 100%;text-align: center;">
             <div style="margin-top: 100px;">
-              <Icon type="logo-dropbox" color="#b6b6b6" size="42" />
+              <Icon type="logo-dropbox" color="#b6b6b6" size="42"/>
               <span style="display: block;color:#b6b6b6;margin-top: 5px;">请从左侧勾选以选择常用功能</span>
             </div>
           </div>
         </div>
       </div>
     </DkModal>
-    <!--    常用功能-->
-    <Card class="card" style="margin-top: 0" @contextmenu.native.prevent>
-      <p slot="title">
-        常用功能
-      </p>
-      <Button slot="extra" icon="md-create" @click="openFuncModal">
-        自定义
-      </Button>
-      <div style="width: 100%;display: flex;align-items: center;justify-content: space-between;">
-        <div style="width: 25px;" v-if="homeCommonUseList && homeCommonUseList.length > 0">
-          <Icon type="ios-arrow-dropleft" style="cursor: pointer" @click.native="scrollCommonUseCard('left')"
-                size="25"/>
-        </div>
-        <div class="common-use-scroll" style="width: calc(100% - 70px);overflow: hidden;">
-          <div v-if="homeCommonUseList && homeCommonUseList.length>0" style="display:flex;width: max-content;">
-            <div v-for="(hcuItem,hcuIndex) in homeCommonUseList" :key="hcuIndex" style="width: 92px;text-align: center;">
-              <div @click="toPage(hcuItem)" style="cursor: pointer;">
-                <div>
-                  <img style="width: 40px;height: 40px" :src="require('@/assets/images/menu-image/' + hcuItem.menuTag.image )" />
+
+    <div style="display: flex;justify-content: space-between">
+      <!--左侧-->
+      <div style="width: 80%">
+        <!--    常用功能-->
+        <Card class="card" style="margin-top: 0;height: 300px" @contextmenu.native.prevent>
+          <p slot="title">
+            常用功能
+          </p>
+          <Button slot="extra" icon="md-create" @click="openFuncModal">
+            自定义
+          </Button>
+          <div style="width: 100%;display: flex;align-items: center;justify-content: space-between;">
+            <div style="width: 25px;" v-if="homeCommonUseList && homeCommonUseList.length > 0">
+              <Icon type="ios-arrow-dropleft" style="cursor: pointer" @click.native="scrollCommonUseCard('left')"
+                    size="25"/>
+            </div>
+            <div class="common-use-scroll" style="width: calc(100% - 70px);overflow: hidden;">
+              <div v-if="homeCommonUseList && homeCommonUseList.length>0" style="display:flex;width: max-content;">
+                <div v-for="(hcuItem,hcuIndex) in homeCommonUseList" :key="hcuIndex"
+                     style="width: 92px;text-align: center;">
+                  <div @click="toPage(hcuItem)" style="cursor: pointer;">
+                    <div>
+                      <img style="width: 40px;height: 40px"
+                           :src="require('@/assets/images/menu-image/' + hcuItem.menuTag.image )"/>
+                    </div>
+                    <div style="font-size: 13px">{{ hcuItem.menuName }}</div>
+                  </div>
+                </div>
+              </div>
+
+              <div v-else style="display:flex;width: max-content;">
+                <div @click="openFuncModal"
+                     style="cursor:pointer;border: 1px #d5d5d5 dashed;color:#b1b1b1;font-size:16px;height: 60px;width: 200px;background:#eaf9ff;border-radius: 10px;display: flex;align-items: center;justify-content: center;">
+                  添加常用功能
                 </div>
-                <div style="font-size: 13px">{{ hcuItem.menuName }}</div>
               </div>
             </div>
+            <div style="width: 25px;" v-if="homeCommonUseList && homeCommonUseList.length > 0">
+              <Icon type="ios-arrow-dropleft" style="transform: rotate(180deg);cursor: pointer;"
+                    @click.native="scrollCommonUseCard('right')" size="25"/>
+            </div>
           </div>
+        </Card>
 
-          <div v-else style="display:flex;width: max-content;">
-            <div @click="openFuncModal" style="cursor:pointer;border: 1px #d5d5d5 dashed;color:#b1b1b1;font-size:16px;height: 60px;width: 200px;background:#eaf9ff;border-radius: 10px;display: flex;align-items: center;justify-content: center;">添加常用功能</div>
+        <!--    待办-->
+        <Card class="card card-upcoming" style="margin-top: 8px;height: 180px" @contextmenu.native.prevent>
+          <div style="display: flex">
+            <div style="font-size: 16px;font-weight:500;color:#17233d;margin-right: 40px">
+              待办中心
+            </div>
+            <Tabs value="name1" v-model="detailModel" @on-click="detailTabsClick">
+              <TabPane v-for="(item,index) in detailOptions" :key="index" :label="item.label"
+                       :name="item.name"></TabPane>
+            </Tabs>
           </div>
-        </div>
-        <div style="width: 25px;" v-if="homeCommonUseList && homeCommonUseList.length > 0">
-          <Icon type="ios-arrow-dropleft" style="transform: rotate(180deg);cursor: pointer;"
-                @click.native="scrollCommonUseCard('right')" size="25"/>
-        </div>
-      </div>
-    </Card>
-
-    <!--    待办-->
-    <Card class="card card-upcoming" @contextmenu.native.prevent>
-      <div style="display: flex">
-        <div style="font-size: 16px;font-weight:500;color:#17233d;margin-right: 40px">
-          待办中心
-        </div>
-        <Tabs value="name1"  v-model="detailModel" @on-click="detailTabsClick">
-          <TabPane v-for="(item,index) in detailOptions"  :key="index" :label="item.label" :name="item.name"></TabPane>
-        </Tabs>
-      </div>
-      <Tooltip style="cursor: pointer" slot="extra" :content="$v('refresh')" theme="light" >
-        <Button icon="md-refresh" shape="circle" class="circle-button" @click="refreshWaitCenter"></Button>
-      </Tooltip>
-      <div style="display: flex;align-items: center;">
-        <div class="upcoming">
-          <!--销售-->
-          <div class="upcoming-card" v-if="saleFlag"  @click="openDrawer($config.homeDrawType.waitAudit)">
-            <Row>
-              <Col span="6" class="upcoming-card-icon">
-                <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')" style="width: 40px;height: 40px;"/>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-number">
-                  {{ orderCount }}
+          <Tooltip style="cursor: pointer" slot="extra" :content="$v('refresh')" theme="light">
+            <Button icon="md-refresh" shape="circle" class="circle-button" @click="refreshWaitCenter"></Button>
+          </Tooltip>
+          <div style="display: flex;align-items: center;">
+            <div class="upcoming">
+              <!--销售-->
+              <div class="upcoming-card" v-if="saleFlag" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-number">
+                      {{ orderCount }}
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      {{ $t('salePending') }}
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
-                  {{ $t('salePending') }}
+              </div>
+              <!--库存-->
+              <div class="upcoming-card" v-if="inventoryFlag" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-into-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-number">
+                      {{ intoCount }}
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      {{ $t('intoPending') }}
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-            </Row>
-          </div>
-          <!--库存-->
-          <div class="upcoming-card" v-if="inventoryFlag"  @click="openDrawer($config.homeDrawType.waitAudit)">
-            <Row>
-              <Col span="6" class="upcoming-card-icon">
-                <img :src="require('@/assets/images/menu-image/' + 'web-into-pending.png')" style="width: 40px;height: 40px;"/>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-number">
-                  {{ intoCount }}
+              </div>
+              <div class="upcoming-card" v-if="inventoryFlag" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-out-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-number">
+                      {{ outCount }}
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      {{ $t('outPending') }}
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
-                  {{ $t('intoPending') }}
+              </div>
+              <!--资金-->
+              <div class="upcoming-card" v-if="fundFlag" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-fund-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-number">
+                      {{ fundCount }}
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      {{ $t('fundPending') }}
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-            </Row>
+              </div>
+            </div>
           </div>
-          <div class="upcoming-card" v-if="inventoryFlag"  @click="openDrawer($config.homeDrawType.waitAudit)">
-            <Row>
-              <Col span="6" class="upcoming-card-icon">
-                <img :src="require('@/assets/images/menu-image/' + 'web-out-pending.png')" style="width: 40px;height: 40px;"/>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-number">
-                  {{ outCount }}
-                </Row>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
-                  {{ $t('outPending') }}
-                </Row>
-              </Col>
-            </Row>
+        </Card>
+
+        <!-- 实时数据 -->
+        <Card class="card card-upcoming" style="margin-top: 8px;height: 180px" @contextmenu.native.prevent>
+          <div style="display: flex">
+            <div style="font-size: 16px;font-weight:500;color:#17233d;margin-right: 40px">
+              实时数据
+            </div>
+            <Select v-model="realTimeDataType" style="width:200px;margin: 0px 0px 10px 0px" ref="selCp"
+                    @on-change="cpRealTimeDataType">
+              <Option v-for="item in realTimeDataTypeList" :value="item.id" :key="item.id">{{ item.name }}</Option>
+            </Select>
           </div>
-          <!--资金-->
-          <div class="upcoming-card" v-if="fundFlag"  @click="openDrawer($config.homeDrawType.waitAudit)">
-            <Row>
-              <Col span="6" class="upcoming-card-icon">
-                <img :src="require('@/assets/images/menu-image/' + 'web-fund-pending.png')" style="width: 40px;height: 40px;"/>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-number">
-                  {{ fundCount }}
+          <Tooltip style="cursor: pointer" slot="extra" :content="$v('refresh')" theme="light">
+            <Button icon="md-refresh" shape="circle" class="circle-button" @click="refreshRealTimeData "></Button>
+          </Tooltip>
+          <div style="display: flex;align-items: center;">
+            <div class="upcoming">
+              <!--销售订单-->
+              <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                      {{ orderQty }} 单 {{ orderAmt }} 元
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      销售订单
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
-                  {{ $t('fundPending') }}
+              </div>
+              <!--出库订单-->
+              <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-into-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                      {{ outQty }} 单 {{ outAmt }} 元
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      出库订单
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-            </Row>
-          </div>
-        </div>
-      </div>
-    </Card>
-
-    <!-- 实时数据 -->
-    <Card class="card card-upcoming" @contextmenu.native.prevent>
-      <div style="display: flex">
-        <div style="font-size: 16px;font-weight:500;color:#17233d;margin-right: 40px">
-          实时数据
-        </div>
-        <Select v-model="realTimeDataType" style="width:200px;margin: 0px 0px 10px 0px" ref="selCp" @on-change="cpRealTimeDataType">
-          <Option v-for="item in realTimeDataTypeList" :value="item.id" :key="item.id">{{ item.name }}</Option>
-        </Select>
-      </div>
-      <Tooltip style="cursor: pointer" slot="extra" :content="$v('refresh')" theme="light" >
-        <Button icon="md-refresh" shape="circle" class="circle-button" @click="refreshRealTimeData "></Button>
-      </Tooltip>
-      <div style="display: flex;align-items: center;">
-        <div class="upcoming">
-          <!--销售订单-->
-          <div class="upcoming-card"  @click="openDrawer($config.homeDrawType.waitAudit)">
-            <Row>
-              <Col span="6" class="upcoming-card-icon">
-                <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')" style="width: 40px;height: 40px;"/>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
-                {{ orderQty }} 单 {{ orderAmt }} 元
+              </div>
+              <!--退货订单-->
+              <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-out-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                      {{ returnQty }} 单 {{ returnAmt }} 元
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      退货订单
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
-                  销售订单
+              </div>
+              <!--新增客户-->
+              <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                      {{ cusQty }} 单 {{ cusAmt }} 元
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      新增客户
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-            </Row>
+              </div>
+            </div>
           </div>
-          <!--出库订单-->
-          <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
-            <Row>
-              <Col span="6" class="upcoming-card-icon">
-                <img :src="require('@/assets/images/menu-image/' + 'web-into-pending.png')" style="width: 40px;height: 40px;"/>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
-                  {{ outQty }} 单 {{ outAmt }} 元
-                </Row>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
-                  出库订单
-                </Row>
-              </Col>
-            </Row>
+        </Card>
+
+        <!-- 经营概况 -->
+        <Card class="card card-upcoming" style="margin-top: 8px;height: 280px" @contextmenu.native.prevent>
+          <div style="display: flex">
+            <div style="font-size: 16px;font-weight:500;color:#17233d;margin-right: 40px">
+              经营概况
+            </div>
+            <DatePickerPop type="daterange" clearable size="small" :editable="true"
+                           transfer v-model="accDate"
+                           placement="bottom-end" @on-change="(val) => btnDatePickerOk(val)"
+                           style="width:218px; margin: 0px 0px 10px 0px" :short-cut-flag="true"></DatePickerPop>
           </div>
-          <!--退货订单-->
-          <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
-            <Row>
-              <Col span="6" class="upcoming-card-icon">
-                <img :src="require('@/assets/images/menu-image/' + 'web-out-pending.png')" style="width: 40px;height: 40px;"/>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
-                  {{ returnQty }} 单 {{ returnAmt }} 元
+          <Tooltip style="cursor: pointer" slot="extra" :content="$v('refresh')" theme="light">
+            <Button icon="md-refresh" shape="circle" class="circle-button" @click="selectBusinessOverview "></Button>
+          </Tooltip>
+          <div style="display: flex;align-items: center;">
+            <div class="upcoming">
+              <!--库存资产-->
+              <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                      ¥ {{ intAssets }}
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      库存资产(实时)
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
-                  退货订单
-                </Row>
-              </Col>
-            </Row>
-          </div>
-          <!--新增客户-->
-          <div class="upcoming-card"  @click="openDrawer($config.homeDrawType.waitAudit)">
-            <Row>
-              <Col span="6" class="upcoming-card-icon">
-                <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')" style="width: 40px;height: 40px;"/>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
-                  {{ cusQty }} 单 {{ cusAmt }} 元
+              </div>
+              <!--客户欠款-->
+              <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="6" class="upcoming-card-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-out-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                      ¥ {{ receivableResidue }}
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                      客户欠款(实时)
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-              <Col span="18">
-                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
-                  新增客户
+              </div>
+              <!--销售利润-->
+              <div class="upcoming-card1" @click="openDrawer($config.homeDrawType.waitAudit)">
+                <Row>
+                  <Col span="3" class="upcoming-card1-icon">
+                    <img :src="require('@/assets/images/menu-image/' + 'web-into-pending.png')"
+                         style="width: 40px;height: 40px;"/>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card1-text" style="margin: 15px 0px 0px 5px">
+                      销售金额: ¥{{ receivable }} 销售成本: ¥{{ costAmt }}
+                    </Row>
+                  </Col>
+                  <Col span="18">
+                    <Row class="upcoming-card1-text" style="margin: 0px 0px 0px 55px">
+                      销售利润: ¥{{ profit }} 利润率: {{ profitMargin }}%
+                    </Row>
+                  </Col>
                 </Row>
-              </Col>
-            </Row>
+              </div>
+            </div>
           </div>
-        </div>
+        </Card>
       </div>
-    </Card>
+      <!--右侧-->
+      <div style="width: 20%;margin-left: 8px">
+        <!-- 产品公告 -->
+        <Card class="card" style="margin-top: 0;height: 300px" @contextmenu.native.prevent>
+          <p slot="title">
+            产品公告
+          </p>
+          <Button slot="extra" icon="md-create" @click="moreProductAnnouncement">
+            更多
+          </Button>
+        </Card>
+
+        <!-- 走马灯 -->
+        <Card class="card card-upcoming" style="margin-top: 8px;height: 367px" @contextmenu.native.prevent>
+          <Carousel autoplay :height="350" :autoplay-speed="10000" :radius-dot="true" loop>
+            <CarouselItem v-for="(item, index) in dataCarouselItems">
+              <img :src="$config.imgUrl + item.annexPaths[0].url" style="width: 100%;height: 95%;cursor:pointer"
+                   @click="showActivity(item)">
+            </CarouselItem>
+          </Carousel>
+        </Card>
 
+        <!-- 新手指导 -->
+        <Card class="card" style="margin-top: 8px;height: 280px" @contextmenu.native.prevent>
+          <p slot="title">
+            新手指导
+          </p>
+          <Button slot="extra" icon="md-create" @click="beginnersGuide">
+            快速掌握
+          </Button>
+          <div style="width:100%;text-align: center;">
+            <img src="@/assets/images/dkic-code.png" style="width: 40%;height: 40%;">
+          </div>
+        </Card>
+      </div>
+    </div>
     <!--    底部留白-->
     <div style="width: 100%; height: 20px"></div>
   </div>
 </template>
 
 <script>
-  import funcIcon from '../../../assets/images/func-icon.png'
-  import draggable from "vuedraggable"
-  export default {
-    name: 'home',
-    components: {
-      draggable,
-    },
-    data() {
-      let self = this
-      return {
-        drawType: self.$config.homeDrawType.waitAudit, // 首页抽屉类型
-        approvalCount: null , // 待审条数
-        unReadNoticeCount: null, // 未读公告条数
-        waitApprovalRight:false,// 待审中心权限
-        approveSplit: 0.6,
-        funcIcon,
-        /*****************常用功能*****************/
-        funcModal: false,
-        funcModalLoading: false,
-        funcList: [],
-        rightFuncList: [],
-        homeCommonUseList: [],
-        /*****************常用功能*****************/
+import funcIcon from '../../../assets/images/func-icon.png'
+import draggable from "vuedraggable"
+import {indexMixin} from '@/mixins'
 
-        /*****************待办*****************/
-        detailModel: 'sale',
-        detailOptions: [
-          {label: self.$t('sale'), name: 'sale'}, //销售
-          {label: self.$t('inventory'), name: 'inventory'},//库存
-          {label: self.$t('fund'), name: 'fund'},//资金
-        ],
-        saleFlag:true,
-        inventoryFlag:false,
-        fundFlag:false,
-        fundCount:0,
-        outCount:0,
-        intoCount:0,
-        orderCount:0,
-        /*****************待办*****************/
+export default {
+  name: 'home',
+  mixins: [indexMixin],
+  components: {
+    draggable,
+  },
+  data() {
+    let self = this
+    return {
+      dataCarouselItems: [],
+      // {path: "@/assets/images/icon_file.png", cIndex: 1}, //销售
+      // {path: "@/assets/images/icon_file.png", cIndex: 2},//库存
+      // {path: "@/assets/images/icon_file.png", cIndex: 3},//资金
+      // ],
+      drawType: self.$config.homeDrawType.waitAudit, // 首页抽屉类型
+      approvalCount: null, // 待审条数
+      unReadNoticeCount: null, // 未读公告条数
+      waitApprovalRight: false,// 待审中心权限
+      approveSplit: 0.6,
+      funcIcon,
+      /*****************常用功能*****************/
+      funcModal: false,
+      funcModalLoading: false,
+      funcList: [],
+      rightFuncList: [],
+      homeCommonUseList: [],
+      /*****************常用功能*****************/
 
-        //公告
-        managementTableData: [],
-        //图表颜色
-        colors: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],
-        // 日期配置
-        dateOptions: {
-          shortcuts: [
-            {
-              text: '一月',
-              value() {
-                return self.getThisMonth(1)
-              }
-            },
-            {
-              text: '二月',
-              value() {
-                return self.getThisMonth(2)
-              }
-            },
-            {
-              text: '三月',
-              value() {
-                return self.getThisMonth(3)
-              }
-            },
-            {
-              text: '四月',
-              value() {
-                return self.getThisMonth(4)
-              }
-            },
-            {
-              text: '五月',
-              value() {
-                return self.getThisMonth(5)
-              }
-            },
-            {
-              text: '六月',
-              value() {
-                return self.getThisMonth(6)
-              }
-            },
-            {
-              text: '七月',
-              value() {
-                return self.getThisMonth(7)
-              }
-            },
-            {
-              text: '八月',
-              value() {
-                return self.getThisMonth(8)
-              }
-            },
-            {
-              text: '九月',
-              value() {
-                return self.getThisMonth(9)
-              }
-            },
-            {
-              text: '十月',
-              value() {
-                return self.getThisMonth(10)
-              }
-            },
-            {
-              text: '十一月',
-              value() {
-                return self.getThisMonth(11)
-              }
-            },
-            {
-              text: '十二月',
-              value() {
-                return self.getThisMonth(12)
-              }
-            },
-            {
-              text: '一季度',
-              value() {
-                return self.getThisQuarter(1)
-              }
-            },
-            {
-              text: '二季度',
-              value() {
-                return self.getThisQuarter(2)
-              }
-            },
-            {
-              text: '三季度',
-              value() {
-                return self.getThisQuarter(3)
-              }
-            },
-            {
-              text: '四季度',
-              value() {
-                return self.getThisQuarter(4)
-              }
-            },
-          ]
-        },
-        // 抽屉
-        drawerShow: false,
-        // 抽屉标题
-        drawerTitle: null,
-        // 抽屉表格
-        drawerTableData: [],
-        // 抽屉表格列
-        drawerTableColumn: [],
-        // 业绩日期范围
-        performanceDate: self.getThisMonth(),
-        // 业务门店select v-model
-        performanceStore: '全部门店',
-        // 门店
-        performanceStoreList: [
+      /*****************待办*****************/
+      detailModel: 'sale',
+      detailOptions: [
+        {label: self.$t('sale'), name: 'sale'}, //销售
+        {label: self.$t('inventory'), name: 'inventory'},//库存
+        {label: self.$t('fund'), name: 'fund'},//资金
+      ],
+      saleFlag: true,
+      inventoryFlag: false,
+      fundFlag: false,
+      fundCount: 0,
+      outCount: 0,
+      intoCount: 0,
+      orderCount: 0,
+      /*****************待办*****************/
+
+      //公告
+      managementTableData: [],
+      //图表颜色
+      colors: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],
+      // 日期配置
+      dateOptions: {
+        shortcuts: [
           {
-            value: '全部门店',
-            label: '全部门店'
+            text: '一月',
+            value() {
+              return self.getThisMonth(1)
+            }
           },
           {
-            value: 'A门店',
-            label: 'A门店'
+            text: '二月',
+            value() {
+              return self.getThisMonth(2)
+            }
           },
           {
-            value: 'B门店',
-            label: 'B门店'
+            text: '三月',
+            value() {
+              return self.getThisMonth(3)
+            }
           },
-        ],
-        // 销售简报页面类型
-        salesReportType: 1,
-        // 销售简报公司select v-model
-        salesReportCompany: 'A公司',
-        salesReportCompanyList: [
           {
-            value: 'A公司',
-            label: 'A公司'
+            text: '四月',
+            value() {
+              return self.getThisMonth(4)
+            }
           },
           {
-            value: 'B公司',
-            label: 'B公司'
+            text: '五月',
+            value() {
+              return self.getThisMonth(5)
+            }
           },
-        ],
-        // 销售简报人员 v-model
-        salesReportStaff: 'A员工',
-        // 销售简报人员List
-        salesReportStaffList: [
           {
-            value: 'A员工',
-            label: 'A员工'
+            text: '六月',
+            value() {
+              return self.getThisMonth(6)
+            }
           },
           {
-            value: 'B员工',
-            label: 'B员工'
+            text: '七月',
+            value() {
+              return self.getThisMonth(7)
+            }
           },
-        ],
-        // 销售简报radio
-        salesReportRadio: '销售情况',
-        // 销售助手天数list
-        salesHelperDaysList: [
           {
-            value: '7',
-            label: '7天'
+            text: '八月',
+            value() {
+              return self.getThisMonth(8)
+            }
           },
           {
-            value: '15',
-            label: '15天'
+            text: '九月',
+            value() {
+              return self.getThisMonth(9)
+            }
           },
           {
-            value: '30',
-            label: '30天'
+            text: '十月',
+            value() {
+              return self.getThisMonth(10)
+            }
           },
-        ],
-        // 销售助手天数1
-        salesHelperDays1: '7',
-        // 销售助手天数2
-        salesHelperDays2: '15',
-        // 销售助手天数3
-        salesHelperDays3: '30',
-
-        /***************** 实时数据 ******************/
-        realTimeDataType:"经营日报",
-        orderQty:0,
-        orderAmt:0,
-        outQty:0,
-        outAmt:0,
-        returnQty:0,
-        returnAmt:0,
-        cusQty:0,
-        cusAmt:0,
-        realTimeDataTypeList:[
-          {"id":"经营日报", "name":"经营日报"},
-          {"id":"经营月报", "name":"经营月报"}
-          ],
-        /***************** 实时数据 ******************/
-      }
-    },
-    mounted() {
-      // 监听页面,如果大小变化,抽屉关闭
-      let self = this
-      window.addEventListener('resize', function (e) {
-        self.drawerShow = false;
-      })
-    },
-    methods: {
-      /****************************************常用功能****************************************/
-      /**
-       *   @desc   : 常用功能弹窗查询数据
-       *   @date   : 2024/4/28 15:02
-       *   @author : 寇珊珊
-       */
-      openFuncModal() {
-        this.funcModal = true
-        let hadMenuUuidList = this.homeCommonUseList.map(it => it.menuUuid)
-        let rightFuncList = []
-        this.funcList.forEach(it => {
-          if (it.children && it.children.length > 0) {
-            it.children.forEach(it2 => {
-              this.$set(it2, '_checked', false)
-              if (hadMenuUuidList.indexOf(it2.menuUuid) !== -1) {
-                rightFuncList.push(Object.assign(it2, {displayNo: hadMenuUuidList.indexOf(it2.menuUuid)}))
-                this.$set(it2, '_checked', true)
-              }
-            })
-          }
-        })
-        this.rightFuncList = rightFuncList.sort((x, y) => {
-          return x.displayNo - y.displayNo
-        })
-      },
-      /**
-       * @desc   : 关闭常用功能界面
-       * @author : 周兴
-       * @date   : 2022/8/22 14:38
-       */
-      closeCommonUse() {
-        this.funcModal = false
-      },
-      /**
-       * @desc   : 保存常用功能
-       * @author : 周兴
-       * @date   : 2022/8/22 14:25
-       */
-      saveCommonUse() {
-        this.funcModalLoading = true
-        let params = this.rightFuncList.map((it, index) => {
-          return {userId: this.$store.state.user.id, displayNo: index, menuUuid: it.menuUuid, menuName:it.meta.title}
-        })
-        console.log("保存常用功能",params )
-        let excute =  this.excute(this.$service.appMenuService, this.$service.appMenuService.save, params)
-        excute.then(res => {
-          this.funcModalLoading = false
-          this.funcModal = false
-          if (res.code === this.$config.SUCCESS_CODE) {
-            this.selectCommonUse()
-          }
-        })
-        return excute;
-      },
-      /**
-       * @desc   : 查询常用功能
-       * @author : 周兴
-       * @date   : 2022/8/22 14:16
-       */
-      selectCommonUse() {
-        let params = {
-          appCode:this.$config.appCode.WEB,
-          staffId:this.$store.state.user.staffId,
-        }
-        this.excute(this.$service.appMenuService, this.$service.appMenuService.selectMenu,params).then(res => {
-          if (res.code === this.$config.SUCCESS_CODE) {
-            this.homeCommonUseList = res.data
-          }
-        })
-      },
-      toPage(menu) {
-        this.$router.push({path: menu.menuTag.path})
-      },
-      /**
-       * @desc   : 滚动菜单
-       * @author : 周兴
-       * @date   : 2022/8/30 18:53
-       */
-      scrollCommonUseCard(e) {
-        for (let i = 0; i < 701; i++) {
-          setTimeout(function () {
-            if (e == 'left') {
-              document.getElementsByClassName('common-use-scroll')[0].scrollLeft--
-            } else {
-              document.getElementsByClassName('common-use-scroll')[0].scrollLeft++
+          {
+            text: '十一月',
+            value() {
+              return self.getThisMonth(11)
             }
-          }, 100 + i)
-        }
-      },
-      /**
-       * @desc   : 获取常用功能的菜单
-       * @author : 周兴
-       * @date   : 2022/8/22 10:47
-       */
-      getCommonMenu(){
-        if(this.$store.state.app.menuList && this.$store.state.app.menuList.length > 0){
-          let menuList = [...this.$store.state.app.menuList]
-          let funcList = []
-          menuList.forEach(it =>{
-            let funcItem = {}
-            // 不包括首页
-            if(it.name != 'home'){
-              funcItem.name = it.name;
-              funcItem.menuUuid = it.menuUuid;
-              funcItem.parentUuid = it.parentUuid;
-              funcItem.meta = it.meta;
+          },
+          {
+            text: '十二月',
+            value() {
+              return self.getThisMonth(12)
             }
-            // 查询子级
-            if(it.children && it.children.length > 0){
-              let funcListChilds = this.getCommonChild(it.children);
-              if(funcListChilds && funcListChilds.length > 0){
-                funcItem.children = funcListChilds;
-                funcList.push(funcItem);
-              }
+          },
+          {
+            text: '一季度',
+            value() {
+              return self.getThisQuarter(1)
             }
-          })
-          this.funcList = funcList;
-        }
-      },
-      /**
-       * @desc   : 获取子级的菜单
-       * @author : 周兴
-       * @date   : 2022/8/22 11:11
-       */
-      getCommonChild(children){
-        let funcList = []
-        if(children && children.length > 0){
-          children.forEach(it=>{
-            // 说明要需要进行快捷的菜单
-              let funcItem = {}
-              funcItem.name = it.name;
-              funcItem.meta = it.meta;
-              funcItem.menuUuid = it.menuUuid;
-              funcItem.parentUuid = it.parentUuid;
-              funcList.push(funcItem);
-            // 如果还有子级,需要去查询子级
-            if(it.children && it.children.length > 0){
-              let funcListChilds = this.getCommonChild(it.children);
-              if(funcListChilds && funcListChilds.length > 0){
-                funcListChilds.forEach(c=>{
-                  if(c.parentUuid){
-                    let index = funcList.findIndex(item => c.parentUuid === item.menuUuid);
-                    if(index >= 0){
-                      funcList.splice(index + 1,0,c);
-                    }else{
-                      funcList.push(c);
-                    }
-                  }else{
-                    funcList.push(c);
-                  }
-                })
-              }
+          },
+          {
+            text: '二季度',
+            value() {
+              return self.getThisQuarter(2)
             }
-          })
-        }
-        return funcList;
-      },
-      /**
-       *   @desc   : 常用功能弹窗全部清空
-       *   @date   : 2024/4/29 13:58
-       *   @author : 寇珊珊
-       */
-      clearAll(){
-        this.rightFuncList.forEach(it=>{
-          this.funcCheckBoxChangeRight('name-'+it.menuUuid)
-        })
-      },
-      funcCheckBoxChangeRight(name){
-        this.$refs[name][0].$el.click()
-      },
-      /**
-       *   @desc   : 常用功能弹窗左侧选择事件
-       *   @date   : 2024/4/29 14:00
-       *   @author : 寇珊珊
-       */
-      funcCheckBoxChange(flag, item) {
-        // menuUuid
-        if (flag) {
-          this.rightFuncList.push(item)
-        } else {
-          this.rightFuncList = this.rightFuncList.filter(it => it.menuUuid !== item.menuUuid)
-        }
+          },
+          {
+            text: '三季度',
+            value() {
+              return self.getThisQuarter(3)
+            }
+          },
+          {
+            text: '四季度',
+            value() {
+              return self.getThisQuarter(4)
+            }
+          },
+        ]
       },
-      /****************************************常用功能****************************************/
+      // 抽屉
+      drawerShow: false,
+      // 抽屉标题
+      drawerTitle: null,
+      // 抽屉表格
+      drawerTableData: [],
+      // 抽屉表格列
+      drawerTableColumn: [],
+      // 业绩日期范围
+      performanceDate: self.getThisMonth(),
+      // 业务门店select v-model
+      performanceStore: '全部门店',
+      // 门店
+      performanceStoreList: [
+        {
+          value: '全部门店',
+          label: '全部门店'
+        },
+        {
+          value: 'A门店',
+          label: 'A门店'
+        },
+        {
+          value: 'B门店',
+          label: 'B门店'
+        },
+      ],
+      // 销售简报页面类型
+      salesReportType: 1,
+      // 销售简报公司select v-model
+      salesReportCompany: 'A公司',
+      salesReportCompanyList: [
+        {
+          value: 'A公司',
+          label: 'A公司'
+        },
+        {
+          value: 'B公司',
+          label: 'B公司'
+        },
+      ],
+      // 销售简报人员 v-model
+      salesReportStaff: 'A员工',
+      // 销售简报人员List
+      salesReportStaffList: [
+        {
+          value: 'A员工',
+          label: 'A员工'
+        },
+        {
+          value: 'B员工',
+          label: 'B员工'
+        },
+      ],
+      // 销售简报radio
+      salesReportRadio: '销售情况',
+      // 销售助手天数list
+      salesHelperDaysList: [
+        {
+          value: '7',
+          label: '7天'
+        },
+        {
+          value: '15',
+          label: '15天'
+        },
+        {
+          value: '30',
+          label: '30天'
+        },
+      ],
+      // 销售助手天数1
+      salesHelperDays1: '7',
+      // 销售助手天数2
+      salesHelperDays2: '15',
+      // 销售助手天数3
+      salesHelperDays3: '30',
 
-      /****************************************待办功能****************************************/
-      /**
-       *   @desc   : 待办切换
-       *   @date   : 2024/4/28 17:01
-       *   @author : 寇珊珊
-       */
-      detailTabsClick(val) {
-        this.detailModel= val
-        //销售
-        if (val === 'sale') {
-          this.saleFlag = true
-          this.inventoryFlag = false
-          this.fundFlag = false
-        }
-        //库存
-        else if (val === 'inventory') {
-          this.saleFlag = false
-          this.inventoryFlag = true
-          this.fundFlag = false
-        }
-        //资金
-        else if(val === 'fund'){
-          this.saleFlag = false
-          this.inventoryFlag = false
-          this.fundFlag = true
+      /***************** 实时数据 ******************/
+      realTimeDataType: "经营日报",
+      orderQty: 0,
+      orderAmt: 0,
+      outQty: 0,
+      outAmt: 0,
+      returnQty: 0,
+      returnAmt: 0,
+      cusQty: 0,
+      cusAmt: 0,
+      realTimeDataTypeList: [
+        {"id": "经营日报", "name": "经营日报"},
+        {"id": "经营月报", "name": "经营月报"}
+      ],
+      /***************** 实时数据 ******************/
+
+      /***************** 经营概况 ******************/
+      accDate: [new Date().addMonths(-1).format('yyyy-MM-dd'), new Date().format('yyyy-MM-dd')],
+      accDateStart: new Date().addMonths(-1).format('yyyy-MM-dd'),
+      accDateEnd: new Date().format('yyyy-MM-dd'),
+      intAssets: 0,
+      receivableResidue: 0,
+      costAmt: 0,
+      profitMargin: 0,
+      receivable: 0,
+      profit: 0,
+      /***************** 经营概况 ******************/
+    }
+  },
+  mounted() {
+    // 监听页面,如果大小变化,抽屉关闭
+    let self = this
+    window.addEventListener('resize', function (e) {
+      self.drawerShow = false;
+    })
+  },
+  methods: {
+    /****************************************常用功能****************************************/
+    /**
+     *   @desc   : 常用功能弹窗查询数据
+     *   @date   : 2024/4/28 15:02
+     *   @author : 寇珊珊
+     */
+    openFuncModal() {
+      this.funcModal = true
+      let hadMenuUuidList = this.homeCommonUseList.map(it => it.menuUuid)
+      let rightFuncList = []
+      this.funcList.forEach(it => {
+        if (it.children && it.children.length > 0) {
+          it.children.forEach(it2 => {
+            this.$set(it2, '_checked', false)
+            if (hadMenuUuidList.indexOf(it2.menuUuid) !== -1) {
+              rightFuncList.push(Object.assign(it2, {displayNo: hadMenuUuidList.indexOf(it2.menuUuid)}))
+              this.$set(it2, '_checked', true)
+            }
+          })
         }
-        //查询待办个数
-        this.selectPending()
-      },
-      /**
-       *   @desc   : 刷新待办中心数据
-       *   @date   : 2024/4/29 11:04
-       *   @author : 寇珊珊
-       */
-      refreshWaitCenter(){
-        //查询待办个数
-       this.selectPending()
-      },
-      /**
-       *   @desc   : 查询待办个数
-       *   @date   : 2024/4/28 17:25
-       *   @author : 寇珊珊
-       */
-      selectPending(){
-        //订单
-       if(this.detailModel ==='sale'){
-         let params = {
-           appCode:this.$config.appCode.WEB,
-           orderStatusList:[this.$config.outStatus.daiChuKu,this.$config.outStatus.chuKuZhong],
-         }
-         this.excute(this.$service.orderService, this.$service.orderService.countOrderByCond,params).then(res => {
-           if (res.code === this.$config.SUCCESS_CODE) {
-             this.orderCount = res.data
-           }
-         })
-       }
-       //出入库
-       else if(this.detailModel ==='inventory'){
-         //入库
-         let intoParams = {
-           appCode:this.$config.appCode.WEB,
-         }
-         this.excute(this.$service.otherInboundService, this.$service.otherInboundService.selectWaitInboundCount,intoParams).then(res => {
-           if (res.code === this.$config.SUCCESS_CODE) {
-             this.intoCount = res.data
-           }
-         })
-         //出库
-         let outParams = {
-           appCode:this.$config.appCode.WEB,
-         }
-         this.excute(this.$service.otherOutboundService, this.$service.otherOutboundService.selectWaitOutboundCount,outParams).then(res => {
-           if (res.code === this.$config.SUCCESS_CODE) {
-             this.outCount = res.data
-           }
-         })
-       }
-       //资金
-       else if(this.detailModel ==='fund'){
-         let params = {
-           appCode: this.$config.appCode.WEB,
-           amtResidueZeroFlg: true,
-           accItemType: this.$config.fundType.yingShou,
-         }
-         this.excute(this.$service.accountService, this.$service.accountService.getReceivableAccountItemCount, params).then(res => {
-           if (res.code === this.$config.SUCCESS_CODE) {
-             this.fundCount = res.data
-           }
-         })
-       }
-      },
-      /**
-       * @desc   : 打开抽屉
-       * @author : 洪旭东
-       * @date   : 2022-05-02 17:27
-       */
-      openDrawer(type) {
-        let drawer = document.getElementsByClassName('ivu-drawer-bottom')
-        let leftSider = document.getElementsByClassName('left-sider')
-        if (drawer && leftSider && drawer[0] && leftSider[0]) {
-          // console.log(document.body.clientWidth, leftSider[0].getBoundingClientRect().width)
-          drawer[0].style.width = (document.body.clientWidth - leftSider[0].getBoundingClientRect().width) + 'px'
+      })
+      this.rightFuncList = rightFuncList.sort((x, y) => {
+        return x.displayNo - y.displayNo
+      })
+    },
+    /**
+     * @desc   : 关闭常用功能界面
+     * @author : 周兴
+     * @date   : 2022/8/22 14:38
+     */
+    closeCommonUse() {
+      this.funcModal = false
+    },
+    /**
+     * @desc   : 保存常用功能
+     * @author : 周兴
+     * @date   : 2022/8/22 14:25
+     */
+    saveCommonUse() {
+      this.funcModalLoading = true
+      let params = this.rightFuncList.map((it, index) => {
+        return {userId: this.$store.state.user.id, displayNo: index, menuUuid: it.menuUuid, menuName: it.meta.title}
+      })
+      console.log("保存常用功能", params)
+      let excute = this.excute(this.$service.appMenuService, this.$service.appMenuService.save, params)
+      excute.then(res => {
+        this.funcModalLoading = false
+        this.funcModal = false
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.selectCommonUse()
         }
-        if (type === this.$config.homeDrawType.notice) {
-          // 获取未读公告
-          this.selectManagement();
+      })
+      return excute;
+    },
+    /**
+     * @desc   : 查询常用功能
+     * @author : 周兴
+     * @date   : 2022/8/22 14:16
+     */
+    selectCommonUse() {
+      let params = {
+        appCode: this.$config.appCode.WEB,
+        staffId: this.$store.state.user.staffId,
+      }
+      this.excute(this.$service.appMenuService, this.$service.appMenuService.selectMenu, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.homeCommonUseList = res.data
         }
-        // let self = this;
-        // switch (type){
-        //   case self.$config.homeDrawType.waitAudit:
-        //     this.drawerTitle = "待审中心";
-        //     break;
-        //   case self.$config.homeDrawType.notice:
-        //     this.drawerTitle = "系统公告";
-        //     break;
-        // }
-        this.drawType = type;
-        this.drawerShow = true
-      },
-      /****************************************待办功能****************************************/
-
-      /**
-       * @desc   : 打开审批一览页面
-       * @author : 周兴
-       * @date   : 2022/9/2 14:15
-       */
-      openApprovalIndex(){
-        this.$router.push('/approval/waiting-for-approval/index');
-      },
-      /**
-       * @desc   : 过滤需要显示的菜单
-       * @author : 周兴
-       * @date   : 2022/8/22 9:49
-       */
-      filterShowMenu(arr, list) {
-        arr.children = list.filter(it => it.meta && !it.meta.hideInMenu)
-        arr.children.forEach(it => {
-          // it.meta.url = '../../../assets/images/' +  (it.meta.image?it.meta.image:'func-icon.png');
-          if(!it.meta.image){
-            it.meta.image = 'func-icon.png';
+      })
+    },
+    toPage(menu) {
+      this.$router.push({path: menu.menuTag.path})
+    },
+    /**
+     * @desc   : 滚动菜单
+     * @author : 周兴
+     * @date   : 2022/8/30 18:53
+     */
+    scrollCommonUseCard(e) {
+      for (let i = 0; i < 701; i++) {
+        setTimeout(function () {
+          if (e == 'left') {
+            document.getElementsByClassName('common-use-scroll')[0].scrollLeft--
+          } else {
+            document.getElementsByClassName('common-use-scroll')[0].scrollLeft++
+          }
+        }, 100 + i)
+      }
+    },
+    /**
+     * @desc   : 获取常用功能的菜单
+     * @author : 周兴
+     * @date   : 2022/8/22 10:47
+     */
+    getCommonMenu() {
+      if (this.$store.state.app.menuList && this.$store.state.app.menuList.length > 0) {
+        let menuList = [...this.$store.state.app.menuList]
+        let funcList = []
+        menuList.forEach(it => {
+          let funcItem = {}
+          // 不包括首页
+          if (it.name != 'home') {
+            funcItem.name = it.name;
+            funcItem.menuUuid = it.menuUuid;
+            funcItem.parentUuid = it.parentUuid;
+            funcItem.meta = it.meta;
           }
+          // 查询子级
           if (it.children && it.children.length > 0) {
-            this.filterShowMenu(it, it.children)
+            let funcListChilds = this.getCommonChild(it.children);
+            if (funcListChilds && funcListChilds.length > 0) {
+              funcItem.children = funcListChilds;
+              funcList.push(funcItem);
+            }
           }
         })
-        return arr
-      },
-      /**
-       * @desc   : 切换销售简报模式
-       * @author : 洪旭东
-       * @date   : 2022-05-02 15:32
-       */
-      changeSalesReportModel() {
-        this.salesReportType = this.salesReportType == 1 ? 2 : 1
-      },
-      /**
-       * @desc   : 我的业绩目标
-       * @author : 洪旭东
-       * @date   : 2022-05-02 14:09
-       */
-      drawPerformance1() {
-        let echarts = require('echarts')
-        let echarts1 = echarts.init(document.getElementById('echarts1'))
-        echarts1.setOption(
-          {
-            tooltip: {
-              trigger: 'item',
-              // formatter: '{a} <br/>{b}: {c} ({d}%)'
-            },
-            title: {
-              show: true,
-              text: '报备客户'
-            },
-            series: [
-              {
-                center: ['50%', '80%'],
-                axisLabel: {
-                  formatter: '{value}%'
-                },
-                axisTick: {
-                  splitNumber: 2
-                },
-                axisLine: {
-                  lineStyle: {
-                    color: [
-                      [1, '#3cd343']
-                    ]
-                  }
-                },
-                pointer: {
-                  length: '60%',
-                  width: 4
-                },
-                itemStyle: {
-                  color: '#3cd343',
-                  borderColor: 'lightgreen',
-                },
-                splitNumber: 4,
-                radius: '100%',
-                startAngle: 180,
-                endAngle: 0,
-                name: '报备客户',
-                type: 'gauge',
-                process: {
-                  show: true
-                },
-                detail: {
-                  show: false,
-                  valueAnimation: true,
-                  // formatter: '{value}%'
-                },
-                data: [
-                  {value: 100, name: ''},
-                ],
-              }
-            ]
-          }
-        )
-      },
-      /**
-       * @desc   : 我的业绩目标
-       * @author : 洪旭东
-       * @date   : 2022-05-02 14:09
-       */
-      drawPerformance2() {
-        let echarts = require('echarts')
-        let echarts1 = echarts.init(document.getElementById('echarts2'))
-        echarts1.setOption(
-          {
-            tooltip: {
-              trigger: 'item',
-              // formatter: '{a} <br/>{b}: {c} ({d}%)'
-            },
-            title: {
-              show: true,
-              text: '订货额'
-            },
-            series: [
-              {
-                center: ['50%', '80%'],
-                axisLabel: {
-                  formatter: '{value}%'
-                },
-                axisTick: {
-                  splitNumber: 2
-                },
-                axisLine: {
-                  lineStyle: {
-                    color: [
-                      [1, '#3cd343']
-                    ]
-                  }
-                },
-                pointer: {
-                  length: '60%',
-                  width: 4
-                },
-                itemStyle: {
-                  color: '#3cd343',
-                  borderColor: 'lightgreen',
-                },
-                splitNumber: 4,
-                radius: '100%',
-                startAngle: 180,
-                endAngle: 0,
-                name: '订货额',
-                type: 'gauge',
-                process: {
-                  show: true
-                },
-                detail: {
-                  show: false,
-                  valueAnimation: true,
-                  // formatter: '{value}%'
-                },
-                data: [
-                  {value: 100, name: ''},
-                ],
-              }
-            ]
-          }
-        )
-      },
-      /**
-       * @desc   : 我的业绩目标
-       * @author : 洪旭东
-       * @date   : 2022-05-02 14:09
-       */
-      drawPerformance3() {
-        let echarts = require('echarts')
-        let echarts1 = echarts.init(document.getElementById('echarts3'))
-        echarts1.setOption(
-          {
-            tooltip: {
-              trigger: 'item',
-              // formatter: '{a} <br/>{b}: {c} ({d}%)'
-            },
-            title: {
-              show: true,
-              text: '回款额'
-            },
-            series: [
-              {
-                center: ['50%', '80%'],
-                axisLabel: {
-                  formatter: '{value}%'
-                },
-                axisTick: {
-                  splitNumber: 2
-                },
-                axisLine: {
-                  lineStyle: {
-                    color: [
-                      [1, '#3cd343']
-                    ]
+        this.funcList = funcList;
+      }
+    },
+    /**
+     * @desc   : 获取子级的菜单
+     * @author : 周兴
+     * @date   : 2022/8/22 11:11
+     */
+    getCommonChild(children) {
+      let funcList = []
+      if (children && children.length > 0) {
+        children.forEach(it => {
+          // 说明要需要进行快捷的菜单
+          let funcItem = {}
+          funcItem.name = it.name;
+          funcItem.meta = it.meta;
+          funcItem.menuUuid = it.menuUuid;
+          funcItem.parentUuid = it.parentUuid;
+          funcList.push(funcItem);
+          // 如果还有子级,需要去查询子级
+          if (it.children && it.children.length > 0) {
+            let funcListChilds = this.getCommonChild(it.children);
+            if (funcListChilds && funcListChilds.length > 0) {
+              funcListChilds.forEach(c => {
+                if (c.parentUuid) {
+                  let index = funcList.findIndex(item => c.parentUuid === item.menuUuid);
+                  if (index >= 0) {
+                    funcList.splice(index + 1, 0, c);
+                  } else {
+                    funcList.push(c);
                   }
-                },
-                pointer: {
-                  length: '60%',
-                  width: 4
-                },
-                itemStyle: {
-                  color: '#3cd343',
-                  borderColor: 'lightgreen',
-                },
-                splitNumber: 4,
-                radius: '100%',
-                startAngle: 180,
-                endAngle: 0,
-                name: '回款额',
-                type: 'gauge',
-                process: {
-                  show: true
-                },
-                detail: {
-                  show: false,
-                  valueAnimation: true,
-                  // formatter: '{value}%'
-                },
-                data: [
-                  {value: 100, name: ''},
-                ],
-              }
-            ]
-          }
-        )
-      },
-      /**
-       * @desc   : 跳页
-       * @author : 洪旭东
-       * @date   : 2022-05-02 11:51
-       */
-      jumpTo() {
-        this.$router.push('/sale/order')
-      },
-      getMonthDays(date) {
-        date = date || new Date()
-        const temp = new Date(date.getFullYear(), date.getMonth() + 1, 0)
-        const days = temp.getDate()
-        return days
-      },
-      /**
-       * @desc   : 待办滚动
-       * @author : 洪旭东
-       * @date   : 2022-05-03 17:21
-       */
-      scrollUpcomingCard(e) {
-        for (let i = 0; i < 701; i++) {
-          setTimeout(function () {
-            if (e == 'left') {
-              document.getElementsByClassName('upcoming')[0].scrollLeft--
-            } else {
-              document.getElementsByClassName('upcoming')[0].scrollLeft++
+                } else {
+                  funcList.push(c);
+                }
+              })
             }
-          }, 100 + i)
-        }
-      },
-      getText(str) {
-        let words = str.replace(/<[^<>]+>/g, "").replace(/&nbsp;/gi, ""); //这里是去除标签
-        return words.replace(/\s/g, "") //这里是去除空格
-      },
-      /**
-       *   @desc   : 跳转到公告
-       *   @date   : 2022/8/16 10:29
-       *   @author : 寇珊珊
-       */
-      returnMessage() {
-        this.$router.push('../../mst/notice-list/index')
-      },
-      /**
-       *   @desc   : 跳转公告明细
-       *   @date   : 2022/8/16 11:48
-       *   @author : 寇珊珊
-       */
-      returnMessageDetail(value) {
-        this.$router.push('../../mst/notice-list/detail/' + value.noticeId)
-      },
-      /**
-       * @desc   : 获取待审中心条数
-       * @author : 周兴
-       * @date   : 2022/8/20 14:50
-       */
-      getApprovalCount() {
-        // 参数设置
+          }
+        })
+      }
+      return funcList;
+    },
+    /**
+     *   @desc   : 常用功能弹窗全部清空
+     *   @date   : 2024/4/29 13:58
+     *   @author : 寇珊珊
+     */
+    clearAll() {
+      this.rightFuncList.forEach(it => {
+        this.funcCheckBoxChangeRight('name-' + it.menuUuid)
+      })
+    },
+    funcCheckBoxChangeRight(name) {
+      this.$refs[name][0].$el.click()
+    },
+    /**
+     *   @desc   : 常用功能弹窗左侧选择事件
+     *   @date   : 2024/4/29 14:00
+     *   @author : 寇珊珊
+     */
+    funcCheckBoxChange(flag, item) {
+      // menuUuid
+      if (flag) {
+        this.rightFuncList.push(item)
+      } else {
+        this.rightFuncList = this.rightFuncList.filter(it => it.menuUuid !== item.menuUuid)
+      }
+    },
+    /****************************************常用功能****************************************/
+
+    /****************************************待办功能****************************************/
+    /**
+     *   @desc   : 待办切换
+     *   @date   : 2024/4/28 17:01
+     *   @author : 寇珊珊
+     */
+    detailTabsClick(val) {
+      this.detailModel = val
+      //销售
+      if (val === 'sale') {
+        this.saleFlag = true
+        this.inventoryFlag = false
+        this.fundFlag = false
+      }
+      //库存
+      else if (val === 'inventory') {
+        this.saleFlag = false
+        this.inventoryFlag = true
+        this.fundFlag = false
+      }
+      //资金
+      else if (val === 'fund') {
+        this.saleFlag = false
+        this.inventoryFlag = false
+        this.fundFlag = true
+      }
+      //查询待办个数
+      this.selectPending()
+    },
+    /**
+     *   @desc   : 刷新待办中心数据
+     *   @date   : 2024/4/29 11:04
+     *   @author : 寇珊珊
+     */
+    refreshWaitCenter() {
+      //查询待办个数
+      this.selectPending()
+    },
+    /**
+     *   @desc   : 查询待办个数
+     *   @date   : 2024/4/28 17:25
+     *   @author : 寇珊珊
+     */
+    selectPending() {
+      //订单
+      if (this.detailModel === 'sale') {
         let params = {
-          cpId: this.$store.state.user.cpId,
-          userId: this.$store.state.user.id,
-          querys: Object.assign({treeFlag: true}, this.searchList)
+          appCode: this.$config.appCode.WEB,
+          orderStatusList: [this.$config.outStatus.daiChuKu, this.$config.outStatus.chuKuZhong],
         }
-        waitingForApprovalService.getApprovalCount(params).then(res => {
-          if (res.code === 200) {
-            this.approvalCount = res.data;
-          } else {
-            this.$message.error(res.message)
+        this.excute(this.$service.orderService, this.$service.orderService.countOrderByCond, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.orderCount = res.data
           }
         })
-      },
-      /**
-       *   @desc   : 查询公告
-       *   @date   : 2022/8/16 9:50
-       *   @author : 寇珊珊
-       */
-      selectManagement() {
-        // 参数设置
-        let params = {}
-        if (this.$store.state.user.sysId != this.$config.sysType.SYS_HEGII) {
-          params.cpId = this.$store.state.user.cpId
-          params.sysId = this.$store.state.user.sysId
+      }
+      //出入库
+      else if (this.detailModel === 'inventory') {
+        //入库
+        let intoParams = {
+          appCode: this.$config.appCode.WEB,
         }
-        params.limit = 5; // 限制公告条数
-        params.userId = this.$store.state.user.id
-        // 查询公告分类接口
-        noticeManagementService.getNotice(params).then(res => {
-          if (res.code === 200) {
-            this.managementTableData = res.data
-          } else {
-            this.$message.error(res.message)
+        this.excute(this.$service.otherInboundService, this.$service.otherInboundService.selectWaitInboundCount, intoParams).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.intoCount = res.data
           }
         })
-      },
-      /**
-       * @desc   : 获取未读公告数量
-       * @author : 周兴
-       * @date   : 2022/8/20 14:50
-       */
-      getUnreadNoticeCount() {
-        // 参数设置
-        let params = {}
-        if (this.$store.state.user.sysId != this.$config.sysType.SYS_HEGII) {
-          params.cpId = this.$store.state.user.cpId
-          params.sysId = this.$store.state.user.sysId
+        //出库
+        let outParams = {
+          appCode: this.$config.appCode.WEB,
         }
-        params.userId = this.$store.state.user.id
-        noticeManagementService.getUnreadNoticeCount(params).then(res => {
-          if (res.code === 200) {
-            this.unReadNoticeCount = res.data;
-          } else {
-            this.$message.error(res.message)
+        this.excute(this.$service.otherOutboundService, this.$service.otherOutboundService.selectWaitOutboundCount, outParams).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.outCount = res.data
           }
         })
-      },
-      /**
-       * @desc   : 刷新实时数据
-       * @author : 付斌
-       * @date   : 2024-06-14 16:44
-       */
-      refreshRealTimeData(){
-        // 查询实时数据
-        this.selectRealTimeData()
-      },
-      /**
-       * @desc   : 切换实时数据类型
-       * @author : 付斌
-       * @date   : 2024-06-14 16:43
-       */
-      cpRealTimeDataType(){
-        // 查询实时数据
-        this.selectRealTimeData()
-      },
-      /**
-       * @desc   : 查询实时数据
-       * @author : 付斌
-       * @date   : 2024-06-14 15:13
-       */
-      selectRealTimeData(){
+      }
+      //资金
+      else if (this.detailModel === 'fund') {
         let params = {
-          realTimeDataType:this.realTimeDataType,
+          appCode: this.$config.appCode.WEB,
+          amtResidueZeroFlg: true,
+          accItemType: this.$config.fundType.yingShou,
         }
-        this.excute(this.$service.commonService, this.$service.commonService.getRealTimeData, params).then(res => {
+        this.excute(this.$service.accountService, this.$service.accountService.getReceivableAccountItemCount, params).then(res => {
           if (res.code === this.$config.SUCCESS_CODE) {
-            this.orderQty = res.data.orderQty
-            this.orderAmt = res.data.orderAmt
-            this.outQty = res.data.outQty
-            this.outAmt = res.data.outAmt
-            this.returnQty = res.data.returnQty
-            this.returnAmt = res.data.returnAmt
-            this.cusQty = res.data.cusQty
-            this.cusAmt = res.data.cusAmt
+            this.fundCount = res.data
           }
         })
-      },
+      }
+    },
+    /**
+     * @desc   : 打开抽屉
+     * @author : 洪旭东
+     * @date   : 2022-05-02 17:27
+     */
+    openDrawer(type) {
+      let drawer = document.getElementsByClassName('ivu-drawer-bottom')
+      let leftSider = document.getElementsByClassName('left-sider')
+      if (drawer && leftSider && drawer[0] && leftSider[0]) {
+        // console.log(document.body.clientWidth, leftSider[0].getBoundingClientRect().width)
+        drawer[0].style.width = (document.body.clientWidth - leftSider[0].getBoundingClientRect().width) + 'px'
+      }
+      if (type === this.$config.homeDrawType.notice) {
+        // 获取未读公告
+        this.selectManagement();
+      }
+      // let self = this;
+      // switch (type){
+      //   case self.$config.homeDrawType.waitAudit:
+      //     this.drawerTitle = "待审中心";
+      //     break;
+      //   case self.$config.homeDrawType.notice:
+      //     this.drawerTitle = "系统公告";
+      //     break;
+      // }
+      this.drawType = type;
+      this.drawerShow = true
     },
-    created() {
-      this.routeObjName = 'appMenu'  // 设置路由名称
-      this.getCommonMenu();   // 获取常用功能的菜单
-      this.selectCommonUse();//查询常用功能
-      this.selectPending();//获取代办事项个数
-      this.selectRealTimeData();//查询实时数据
-      // this.getApprovalCount();// 获取待审中心数据
-      // this.getUnreadNoticeCount();// 获取未读公告条数
-      this.waitApprovalRight =this.$libaray.checkButtonHasRight('wait-approval')
+    /****************************************待办功能****************************************/
+
+    /**
+     * @desc   : 打开审批一览页面
+     * @author : 周兴
+     * @date   : 2022/9/2 14:15
+     */
+    openApprovalIndex() {
+      this.$router.push('/approval/waiting-for-approval/index');
     },
-  }
+    /**
+     * @desc   : 过滤需要显示的菜单
+     * @author : 周兴
+     * @date   : 2022/8/22 9:49
+     */
+    filterShowMenu(arr, list) {
+      arr.children = list.filter(it => it.meta && !it.meta.hideInMenu)
+      arr.children.forEach(it => {
+        // it.meta.url = '../../../assets/images/' +  (it.meta.image?it.meta.image:'func-icon.png');
+        if (!it.meta.image) {
+          it.meta.image = 'func-icon.png';
+        }
+        if (it.children && it.children.length > 0) {
+          this.filterShowMenu(it, it.children)
+        }
+      })
+      return arr
+    },
+    /**
+     * @desc   : 切换销售简报模式
+     * @author : 洪旭东
+     * @date   : 2022-05-02 15:32
+     */
+    changeSalesReportModel() {
+      this.salesReportType = this.salesReportType == 1 ? 2 : 1
+    },
+    /**
+     * @desc   : 我的业绩目标
+     * @author : 洪旭东
+     * @date   : 2022-05-02 14:09
+     */
+    drawPerformance1() {
+      let echarts = require('echarts')
+      let echarts1 = echarts.init(document.getElementById('echarts1'))
+      echarts1.setOption(
+        {
+          tooltip: {
+            trigger: 'item',
+            // formatter: '{a} <br/>{b}: {c} ({d}%)'
+          },
+          title: {
+            show: true,
+            text: '报备客户'
+          },
+          series: [
+            {
+              center: ['50%', '80%'],
+              axisLabel: {
+                formatter: '{value}%'
+              },
+              axisTick: {
+                splitNumber: 2
+              },
+              axisLine: {
+                lineStyle: {
+                  color: [
+                    [1, '#3cd343']
+                  ]
+                }
+              },
+              pointer: {
+                length: '60%',
+                width: 4
+              },
+              itemStyle: {
+                color: '#3cd343',
+                borderColor: 'lightgreen',
+              },
+              splitNumber: 4,
+              radius: '100%',
+              startAngle: 180,
+              endAngle: 0,
+              name: '报备客户',
+              type: 'gauge',
+              process: {
+                show: true
+              },
+              detail: {
+                show: false,
+                valueAnimation: true,
+                // formatter: '{value}%'
+              },
+              data: [
+                {value: 100, name: ''},
+              ],
+            }
+          ]
+        }
+      )
+    },
+    /**
+     * @desc   : 我的业绩目标
+     * @author : 洪旭东
+     * @date   : 2022-05-02 14:09
+     */
+    drawPerformance2() {
+      let echarts = require('echarts')
+      let echarts1 = echarts.init(document.getElementById('echarts2'))
+      echarts1.setOption(
+        {
+          tooltip: {
+            trigger: 'item',
+            // formatter: '{a} <br/>{b}: {c} ({d}%)'
+          },
+          title: {
+            show: true,
+            text: '订货额'
+          },
+          series: [
+            {
+              center: ['50%', '80%'],
+              axisLabel: {
+                formatter: '{value}%'
+              },
+              axisTick: {
+                splitNumber: 2
+              },
+              axisLine: {
+                lineStyle: {
+                  color: [
+                    [1, '#3cd343']
+                  ]
+                }
+              },
+              pointer: {
+                length: '60%',
+                width: 4
+              },
+              itemStyle: {
+                color: '#3cd343',
+                borderColor: 'lightgreen',
+              },
+              splitNumber: 4,
+              radius: '100%',
+              startAngle: 180,
+              endAngle: 0,
+              name: '订货额',
+              type: 'gauge',
+              process: {
+                show: true
+              },
+              detail: {
+                show: false,
+                valueAnimation: true,
+                // formatter: '{value}%'
+              },
+              data: [
+                {value: 100, name: ''},
+              ],
+            }
+          ]
+        }
+      )
+    },
+    /**
+     * @desc   : 我的业绩目标
+     * @author : 洪旭东
+     * @date   : 2022-05-02 14:09
+     */
+    drawPerformance3() {
+      let echarts = require('echarts')
+      let echarts1 = echarts.init(document.getElementById('echarts3'))
+      echarts1.setOption(
+        {
+          tooltip: {
+            trigger: 'item',
+            // formatter: '{a} <br/>{b}: {c} ({d}%)'
+          },
+          title: {
+            show: true,
+            text: '回款额'
+          },
+          series: [
+            {
+              center: ['50%', '80%'],
+              axisLabel: {
+                formatter: '{value}%'
+              },
+              axisTick: {
+                splitNumber: 2
+              },
+              axisLine: {
+                lineStyle: {
+                  color: [
+                    [1, '#3cd343']
+                  ]
+                }
+              },
+              pointer: {
+                length: '60%',
+                width: 4
+              },
+              itemStyle: {
+                color: '#3cd343',
+                borderColor: 'lightgreen',
+              },
+              splitNumber: 4,
+              radius: '100%',
+              startAngle: 180,
+              endAngle: 0,
+              name: '回款额',
+              type: 'gauge',
+              process: {
+                show: true
+              },
+              detail: {
+                show: false,
+                valueAnimation: true,
+                // formatter: '{value}%'
+              },
+              data: [
+                {value: 100, name: ''},
+              ],
+            }
+          ]
+        }
+      )
+    },
+    /**
+     * @desc   : 跳页
+     * @author : 洪旭东
+     * @date   : 2022-05-02 11:51
+     */
+    jumpTo() {
+      this.$router.push('/sale/order')
+    },
+    getMonthDays(date) {
+      date = date || new Date()
+      const temp = new Date(date.getFullYear(), date.getMonth() + 1, 0)
+      const days = temp.getDate()
+      return days
+    },
+    /**
+     * @desc   : 待办滚动
+     * @author : 洪旭东
+     * @date   : 2022-05-03 17:21
+     */
+    scrollUpcomingCard(e) {
+      for (let i = 0; i < 701; i++) {
+        setTimeout(function () {
+          if (e == 'left') {
+            document.getElementsByClassName('upcoming')[0].scrollLeft--
+          } else {
+            document.getElementsByClassName('upcoming')[0].scrollLeft++
+          }
+        }, 100 + i)
+      }
+    },
+    getText(str) {
+      let words = str.replace(/<[^<>]+>/g, "").replace(/&nbsp;/gi, ""); //这里是去除标签
+      return words.replace(/\s/g, "") //这里是去除空格
+    },
+    /**
+     *   @desc   : 跳转到公告
+     *   @date   : 2022/8/16 10:29
+     *   @author : 寇珊珊
+     */
+    returnMessage() {
+      this.$router.push('../../mst/notice-list/index')
+    },
+    /**
+     *   @desc   : 跳转公告明细
+     *   @date   : 2022/8/16 11:48
+     *   @author : 寇珊珊
+     */
+    returnMessageDetail(value) {
+      this.$router.push('../../mst/notice-list/detail/' + value.noticeId)
+    },
+    /**
+     * @desc   : 获取待审中心条数
+     * @author : 周兴
+     * @date   : 2022/8/20 14:50
+     */
+    getApprovalCount() {
+      // 参数设置
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        userId: this.$store.state.user.id,
+        querys: Object.assign({treeFlag: true}, this.searchList)
+      }
+      waitingForApprovalService.getApprovalCount(params).then(res => {
+        if (res.code === 200) {
+          this.approvalCount = res.data;
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
+    /**
+     *   @desc   : 查询公告
+     *   @date   : 2022/8/16 9:50
+     *   @author : 寇珊珊
+     */
+    selectManagement() {
+      // 参数设置
+      let params = {}
+      if (this.$store.state.user.sysId != this.$config.sysType.SYS_HEGII) {
+        params.cpId = this.$store.state.user.cpId
+        params.sysId = this.$store.state.user.sysId
+      }
+      params.limit = 5; // 限制公告条数
+      params.userId = this.$store.state.user.id
+      // 查询公告分类接口
+      noticeManagementService.getNotice(params).then(res => {
+        if (res.code === 200) {
+          this.managementTableData = res.data
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
+    /**
+     * @desc   : 获取未读公告数量
+     * @author : 周兴
+     * @date   : 2022/8/20 14:50
+     */
+    getUnreadNoticeCount() {
+      // 参数设置
+      let params = {}
+      if (this.$store.state.user.sysId != this.$config.sysType.SYS_HEGII) {
+        params.cpId = this.$store.state.user.cpId
+        params.sysId = this.$store.state.user.sysId
+      }
+      params.userId = this.$store.state.user.id
+      noticeManagementService.getUnreadNoticeCount(params).then(res => {
+        if (res.code === 200) {
+          this.unReadNoticeCount = res.data;
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
+    /**
+     * @desc   : 刷新实时数据
+     * @author : 付斌
+     * @date   : 2024-06-14 16:44
+     */
+    refreshRealTimeData() {
+      // 查询实时数据
+      this.selectRealTimeData()
+    },
+    /**
+     * @desc   : 切换实时数据类型
+     * @author : 付斌
+     * @date   : 2024-06-14 16:43
+     */
+    cpRealTimeDataType() {
+      // 查询实时数据
+      this.selectRealTimeData()
+    },
+    /**
+     * @desc   : 查询实时数据
+     * @author : 付斌
+     * @date   : 2024-06-14 15:13
+     */
+    selectRealTimeData() {
+      let params = {
+        realTimeDataType: this.realTimeDataType,
+      }
+      this.excute(this.$service.commonService, this.$service.commonService.getRealTimeData, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.orderQty = res.data.orderQty
+          this.orderAmt = res.data.orderAmt
+          this.outQty = res.data.outQty
+          this.outAmt = res.data.outAmt
+          this.returnQty = res.data.returnQty
+          this.returnAmt = res.data.returnAmt
+          this.cusQty = res.data.cusQty
+          this.cusAmt = res.data.cusAmt
+        }
+      })
+    },
+    /**
+     * @desc   : 查询轮播图
+     * @author : 付斌
+     * @date   : 2024-06-20 10:40
+     */
+    selectCarousel() {
+      let params = {
+        appCode: 'CP-WEB',
+        flgBanner: true
+      }
+      this.excute(this.$service.outhActivityService, this.$service.outhActivityService.getActivity, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.dataCarouselItems = res.data
+        }
+      })
+    },
+    /**
+     * @desc   : 打开轮播图活动
+     * @author : 付斌
+     * @date   : 2024-06-20 11:05
+     */
+    showActivity(item) {
+      window.open(item.activityUrl)
+    },
+    /**
+     * @desc   : 更多产品公告
+     * @author : 付斌
+     * @date   : 2024-06-20 11:25
+     */
+    moreProductAnnouncement() {
+      alert('敬请期待')
+    },
+    /**
+     * @desc   : 新手指导快速掌握
+     * @author : 付斌
+     * @date   : 2024-06-20 11:27
+     */
+    beginnersGuide() {
+      this.open(this.$config.routeUrl['home']['beginnersGuide'])
+    },
+    /**
+     * @desc   : 选择区间
+     * @author : 付斌
+     * @date   : 2024-07-02 14:48
+     */
+    btnDatePickerOk(date) {
+      if (date && date.length > 1) {
+        this.accDateStart = date[0]
+        this.accDateEnd = date[1]
+      } else {
+        this.accDateStart = null
+        this.accDateEnd = null
+      }
+      this.selectBusinessOverview()
+    },
+    /**
+     * @desc   : 查询经营概况
+     * @author : 付斌
+     * @date   : 2024-06-20 10:40
+     */
+    selectBusinessOverview() {
+      let querys = {
+        accDateStart: this.accDateStart,
+        accDateEnd: this.accDateEnd
+      }
+      let params = {
+        querys: JSON.stringify(querys)
+      }
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getBusinessOverview, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.intAssets = res.data.intAssets[0].intAssets
+          this.receivableResidue = res.data.receivableResidue[0].receivableResidue
+          this.receivable = res.data.profitMargin[0].receivable
+          this.costAmt = res.data.profitMargin[0].costAmt
+          this.profit = res.data.profitMargin[0].profit
+          this.profitMargin = res.data.profitMargin[0].profitMargin
+        }
+      })
+    },
+  },
+  created() {
+    this.routeObjName = 'appMenu'  // 设置路由名称
+    this.getCommonMenu();   // 获取常用功能的菜单
+    this.selectCommonUse();//查询常用功能
+    this.selectPending();//获取代办事项个数
+    this.selectRealTimeData();//查询实时数据
+    this.selectCarousel();//查询轮播图
+    this.selectBusinessOverview(); //经营概况
+    // this.getApprovalCount();// 获取待审中心数据
+    // this.getUnreadNoticeCount();// 获取未读公告条数
+    this.waitApprovalRight = this.$libaray.checkButtonHasRight('wait-approval')
+  },
+}
 </script>
 <style lang="less" scoped>
-  .func-item-title {
-    font-size: 12px;
-    margin-top: 5px;
-  }
+.func-item-title {
+  font-size: 12px;
+  margin-top: 5px;
+}
 
-  /deep/.ivu-tabs-nav .ivu-tabs-tab  {
-    bottom: 5px;
-    font-size: 14px !important;
-  }
+/deep/ .ivu-tabs-nav .ivu-tabs-tab {
+  bottom: 5px;
+  font-size: 14px !important;
+}
 
-  /deep/ .ttt > .ivu-checkbox {
-    position: absolute !important;
-    z-index: 1;
-    right: 24%;
-    top: -8%;
-  }
+/deep/ .ttt > .ivu-checkbox {
+  position: absolute !important;
+  z-index: 1;
+  right: 24%;
+  top: -8%;
+}
 
-  .draggable-div[draggable=true] {
-    //opacity: 0 !important;
-  }
+.draggable-div[draggable=true] {
+  //opacity: 0 !important;
+}
 
-  .modal-left-div::-webkit-scrollbar {
-    width: 5px;
-  }
+.modal-left-div::-webkit-scrollbar {
+  width: 5px;
+}
 
-  .modal-left-div::-webkit-scrollbar-track {
-    width: 5px !important;
-    background: #dcdcdc;
-    border-radius: 10px;
-  }
+.modal-left-div::-webkit-scrollbar-track {
+  width: 5px !important;
+  background: #dcdcdc;
+  border-radius: 10px;
+}
 
-  .modal-left-div::-webkit-scrollbar-thumb {
-    width: 5px;
-    background: #b6b6b6;
-    border-radius: 10px;
-  }
+.modal-left-div::-webkit-scrollbar-thumb {
+  width: 5px;
+  background: #b6b6b6;
+  border-radius: 10px;
+}
 
-  //Card标签
-  .card {
-    margin-top: 8px;
-  }
+//Card标签
+.card {
+  margin-top: 8px;
+}
 
-  //圆形按钮
-  .circle-button {
-    font-size: 20px !important;
-    margin-left: 5px;
-    margin-right: 5px;
-  }
+//圆形按钮
+.circle-button {
+  font-size: 20px !important;
+  margin-left: 5px;
+  margin-right: 5px;
+}
 
-  //待办
-  .upcoming {
-    width: 100%;
-    display: -webkit-inline-box;
-    overflow-x: auto;
-    transition: scrollLeft 2s;
-    padding-bottom: 10px;
+//待办
+.upcoming {
+  width: 100%;
+  display: -webkit-inline-box;
+  overflow-x: auto;
+  transition: scrollLeft 2s;
+  padding-bottom: 10px;
 
-    .upcoming-card {
-      height: 100px;
-      width: 200px;
-      background-color: #f4f8ff;
-      padding: 20px 10px 30px 10px;
-      margin-right: 20px;
-      cursor: pointer;
-      border-radius: 15px;
-      //margin-bottom: 10px;
+  .upcoming-card {
+    height: 100px;
+    width: 200px;
+    background-color: #f4f8ff;
+    padding: 20px 10px 30px 10px;
+    margin-right: 20px;
+    cursor: pointer;
+    border-radius: 15px;
+    //margin-bottom: 10px;
 
-      .upcoming-card-icon {
-        //todo 2024年4月29日13:56:25  注释掉
-        /*padding: 16px 0;*/
-      }
+    .upcoming-card-icon {
+      //todo 2024年4月29日13:56:25  注释掉
+      /*padding: 16px 0;*/
+    }
 
-      .upcoming-card-number {
-        font-size: 26px;
-        padding-left: 10px;
-        font-weight: bolder;
-      }
+    .upcoming-card-number {
+      font-size: 26px;
+      padding-left: 10px;
+      font-weight: bolder;
+    }
 
-      .upcoming-card-text {
-        font-size: 13px;
-        font-weight: 500;
-      }
+    .upcoming-card-text {
+      font-size: 13px;
+      font-weight: 500;
     }
   }
 
-  .upcoming::-webkit-scrollbar {
-    width: 0;
-  }
+  .upcoming-card1 {
+    height: 100px;
+    width: 420px;
+    background-color: #f4f8ff;
+    padding: 20px 10px 30px 10px;
+    margin-right: 20px;
+    cursor: pointer;
+    border-radius: 15px;
+    //margin-bottom: 10px;
 
-  .card-upcoming /deep/ .ivu-card-body {
-    padding-bottom: 0 !important;
+    .upcoming-card1-icon {
+      //todo 2024年4月29日13:56:25  注释掉
+      /*padding: 16px 0;*/
+    }
 
-  }
+    .upcoming-card1-number {
+      font-size: 26px;
+      padding-left: 10px;
+      font-weight: bolder;
+    }
 
-  //图表
-  .echarts {
-    width: 300px;
-    height: 200px
+    .upcoming-card1-text {
+      font-size: 13px;
+      font-weight: 500;
+    }
   }
+}
 
-  // 销售简报radio数字
-  .sales-report-radio-number {
-    position: relative;
-    right: 50px;
-  }
+.upcoming::-webkit-scrollbar {
+  width: 0;
+}
 
-  // 销售简报radio选中的文字
-  .sales-report-radio-checked {
-    font-weight: bolder;
-  }
+.card-upcoming /deep/ .ivu-card-body {
+  padding-bottom: 0 !important;
 
-  // 销售简报右侧col
-  .sales-report-col {
-    padding-right: 10px;
-    padding-top: 10px;
-  }
+}
 
-  // 销售简报card 个数 数字
-  .sales-report-card-number {
-    color: grey;
-  }
+//图表
+.echarts {
+  width: 300px;
+  height: 200px
+}
 
-  // 销售简报card 钱数 数字
-  .sales-report-card-money {
-    color: orange;
-  }
+// 销售简报radio数字
+.sales-report-radio-number {
+  position: relative;
+  right: 50px;
+}
 
-  // 销售简报 简略模式card
-  .sales-report-simple-card {
-    margin: 10px;
-  }
+// 销售简报radio选中的文字
+.sales-report-radio-checked {
+  font-weight: bolder;
+}
 
-  // 销售简报 简略模式 文字
-  .sales-report-simple-card-text {
-    font-weight: bolder;
-  }
+// 销售简报右侧col
+.sales-report-col {
+  padding-right: 10px;
+  padding-top: 10px;
+}
 
-  .sales-report-simple-card-text2 {
-    color: grey;
-  }
+// 销售简报card 个数 数字
+.sales-report-card-number {
+  color: grey;
+}
 
-  .sales-report-simple-card-text3 {
-    color: orange;
-  }
+// 销售简报card 钱数 数字
+.sales-report-card-money {
+  color: orange;
+}
 
-  // 销售助手 card 外 col
-  .sales-helper-col {
-    padding: 5px;
-  }
+// 销售简报 简略模式card
+.sales-report-simple-card {
+  margin: 10px;
+}
 
-  // 销售助手 card
-  .sales-helper-card {
-    background-color: #f7f7f9;
-    padding: 5px;
-  }
+// 销售简报 简略模式 文字
+.sales-report-simple-card-text {
+  font-weight: bolder;
+}
 
-  // 销售助手 card 第一行
-  .sales-helper-card-icon-title {
-    display: flex;
-    align-items: center;
-  }
+.sales-report-simple-card-text2 {
+  color: grey;
+}
 
-  // 销售助手 card 标题
-  .sales-helper-card-title {
-    line-height: 34px;
-    margin-left: 10px;
-  }
+.sales-report-simple-card-text3 {
+  color: orange;
+}
 
-  // 销售助手 card 内容 蓝色
-  .sales-helper-card-content {
-    margin-top: 10px;
-    color: #71a6ec;
-  }
+// 销售助手 card 外 col
+.sales-helper-col {
+  padding: 5px;
+}
 
-  // 销售助手 card 内容 灰色
-  .sales-helper-card-content2 {
-    margin-top: 10px;
-    color: grey;
-  }
+// 销售助手 card
+.sales-helper-card {
+  background-color: #f7f7f9;
+  padding: 5px;
+}
 
-  // 底部抽屉
-  /deep/ .ivu-drawer-bottom {
-    right: 0;
-    bottom: 0;
-    top: unset;
-  }
+// 销售助手 card 第一行
+.sales-helper-card-icon-title {
+  display: flex;
+  align-items: center;
+}
 
-  /deep/ .ivu-tabs-tab {
-    bottom: 10px;
-    font-size: 18px !important;
-  }
+// 销售助手 card 标题
+.sales-helper-card-title {
+  line-height: 34px;
+  margin-left: 10px;
+}
 
-  .ivu-row {
-    display: flex;
-  }
+// 销售助手 card 内容 蓝色
+.sales-helper-card-content {
+  margin-top: 10px;
+  color: #71a6ec;
+}
 
-  /deep/ .ivu-list {
-    height: 245px !important;
-    overflow-y: auto;
-  }
+// 销售助手 card 内容 灰色
+.sales-helper-card-content2 {
+  margin-top: 10px;
+  color: grey;
+}
 
-  /deep/ .ivu-list-item-meta-title {
-    margin-bottom: 2px !important;
-    font-size: 15px !important;
-    cursor: pointer;
-    text-decoration: underline;
-  }
+// 底部抽屉
+/deep/ .ivu-drawer-bottom {
+  right: 0;
+  bottom: 0;
+  top: unset;
+}
 
-  /deep/ .ivu-list-item {
-    padding: 10px 0 0 0 !important;
-  }
+/deep/ .ivu-tabs-tab {
+  bottom: 10px;
+  font-size: 18px !important;
+}
 
-  /deep/ .ivu-list-item-meta-content {
-    width: 100%;
-  }
+.ivu-row {
+  display: flex;
+}
 
-  /deep/ .ivu-list-item-meta {
-    margin-bottom: 6px !important;
-  }
+/deep/ .ivu-list {
+  height: 245px !important;
+  overflow-y: auto;
+}
 
-  /deep/ .ivu-list-item-meta-description {
-    //width: 253px;
-    font-size: 12px;
-    line-height: 22px;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-  }
+/deep/ .ivu-list-item-meta-title {
+  margin-bottom: 2px !important;
+  font-size: 15px !important;
+  cursor: pointer;
+  text-decoration: underline;
+}
 
-  /deep/.ivu-checkbox-checked .ivu-checkbox-inner{
-    background-color: #1B365D !important;
-    border-color:  #1B365D !important;
-  }
+/deep/ .ivu-list-item {
+  padding: 10px 0 0 0 !important;
+}
 
-  .clear-btn{
-    border: #b6b6b6 1px dashed;
-    color:#fff;
-    display:flex;
-    align-items:center;
-    justify-content:center;
-    width: 88%;
-    height: 30px;
-    background: #00aaed;
-    border-radius: 5px;
-    cursor: pointer;
-    transition: .3s;
-  }
-  .clear-btn:hover{
-    background: #4dcbff;
-  }
+/deep/ .ivu-list-item-meta-content {
+  width: 100%;
+}
+
+/deep/ .ivu-list-item-meta {
+  margin-bottom: 6px !important;
+}
+
+/deep/ .ivu-list-item-meta-description {
+  //width: 253px;
+  font-size: 12px;
+  line-height: 22px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+/deep/ .ivu-checkbox-checked .ivu-checkbox-inner {
+  background-color: #1B365D !important;
+  border-color: #1B365D !important;
+}
+
+.clear-btn {
+  border: #b6b6b6 1px dashed;
+  color: #fff;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 88%;
+  height: 30px;
+  background: #00aaed;
+  border-radius: 5px;
+  cursor: pointer;
+  transition: .3s;
+}
+
+.clear-btn:hover {
+  background: #4dcbff;
+}
 </style>

+ 101 - 15
src/view/wx-print/index.vue

@@ -1,11 +1,22 @@
 <template>
+  <div>
+    <loading :loading="loading"></loading>
+    <div v-if="loading" class="desc">{{desc}}</div>
 
+    <div v-if="clickCopyCancel||clickCopyOK" class="copy" style="margin-top: 50%">
+      <Icon :type=copyIcon class="copy-icon" :style="{color:(clickCopyOK?'rgb(25,189,107)':'rgb(238,65,18)')}"/>
+    </div>
+    <div class="copy" style="font-size: 24px;color: #17233d;font-weight: bold;margin-top: 10px" v-if="clickCopyCancel||clickCopyOK">{{copyResult}}</div>
+    <div class="copy" style="color: #808695;margin-top: 10px" v-if="clickCopyCancel||clickCopyOK">{{copyDesc}}</div>
+
+  </div>
 </template>
 
 <script>
 import {formMixin} from '@/mixins/form'
 import {hiprint} from "vue-plugin-hiprint";
 import {mapMutations} from "vuex";
+// import VConsole from 'vconsole'
 
 export default {
   mixins: [formMixin],
@@ -16,6 +27,14 @@ export default {
   data() {
     return {
       templateList: [],
+      loading:true,
+      uploadSuccess:false,
+      desc:'正在打印票据,请稍候…',
+      copyIcon:'ios-checkmark-circle',
+      copyResult:'操作成功',
+      copyDesc:'链接复制成功,请复制链接到手机浏览器进行下载',
+      clickCopyOK:false,
+      clickCopyCancel:false,
       // docs:{
       //   // 销售订单
       //   'order':{'docName':this.$config.docCode.order},
@@ -48,11 +67,12 @@ export default {
     blobToFile(blob, fileName) {
       const file = new File([blob], fileName, { type: blob.type })
       return file
-    }
+    },
   },
   created() {
   },
   mounted() {
+    // const vConsole = new VConsole();
     console.log('this.$route.query',this.$route.query)
     if (!this.$route.query.layout_id) {
       this.$Message.warning('请先选择一个模板再打印')
@@ -79,6 +99,8 @@ export default {
       return
     }
 
+
+
     this.setSvcCode(this.$route.query.svc_code)
     let doc = this.$route.query.doc;
     let layout = this.excute(this.$service.printLayoutService, this.$service.printLayoutService.selectByCond, { flgValid: true, docName: this.$config.docCode[doc], cpId:this.$route.query.cp_id})
@@ -87,8 +109,6 @@ export default {
     // let detail=this.excuteNoParam(this.docs[this.$route.query.doc].service, this.docs[this.$route.query.doc].service.selectOrderInfoById, [this.$route.query.data_id])
     Promise.all([data,layout])
       .then((results) => {
-        console.log('data',data)
-        console.log('layout',layout)
 
         // 在这里执行接下来的操作
         if(results?.[0]?.code === this.$config.SUCCESS_CODE){
@@ -102,9 +122,13 @@ export default {
           let hiprintTemplate = new hiprint.PrintTemplate({
             template: layout,
           })
-          //todo
+          console.log('data',header)
+          console.log('layout',layout)
+          console.log('hiprintTemplate',hiprintTemplate)
+
           // hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:'datauristring'}).then(dataURL=>{
           //   let pdf = this.dataURLtoFile(dataURL, "pdf");
+          //   this.pdf=pdf
           //   let formData = new FormData();
           //   formData.append('file', pdf);
           //   this.excute(this.$service.fileService, `upload?folder=pdf&uuid=${this.$route.query.uuid}`,formData).then(res => {
@@ -114,26 +138,88 @@ export default {
           //   })
           // })
 
-          //Blob
-          hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:''}).then(blob=>{
-            let pdf =this.blobToFile(blob, 'blob.pdf')
-            let formData = new FormData();
-            formData.append('file', pdf);
-            this.excute(this.$service.fileService, `upload?folder=pdf&uuid=${this.$route.query.uuid}`,formData).then(res => {
-              if (res.code === this.$config.SUCCESS_CODE) {
-                console.log('upload-res',res)
-              }
+          //is_download用于处理ios不兼容情况
+          if(this.$route.query.is_download==='true'){
+            hiprintTemplate.toPdf(printData, '打印预览pdf');
+          }else{
+            //Blob
+            hiprintTemplate.toPdf(printData,'单据打印',{isDownload:false,type:''}).then(blob=>{
+              let pdf =this.blobToFile(blob, 'blob.pdf')
+              let formData = new FormData();
+              formData.append('file', pdf);
+              this.excute(this.$service.fileService, `upload?folder=pdf&uuid=${this.$route.query.uuid}`,formData).then(res => {
+                if (res.code === this.$config.SUCCESS_CODE) {
+                  console.log('upload-success',res)
+                  this.uploadSuccess=true
+                  this.desc='已成功生成票据PDF!等待下载…'
+                }
+              })
             })
-          })
+            //5秒后弹出提示,引导用户手动下载
+            setTimeout(()=>{
+              if(!this.uploadSuccess){
+                this.$Modal.confirm({
+                  title: '打印票据遇到问题?',
+                  content: '<p>如页面长时间无响应,请点击【确定】按钮,复制链接到手机浏览器下载票据文件</p>',
+                  onOk: () => {
+                    this.loading=false
+
+                    this.clickCopyOK=true
+
+                    let baseUrl=this.$config.serviceUrl
+
+                    let url=baseUrl.substring(0,baseUrl.indexOf('/',8),)+'/wx-print?svc_code=' +this.$route.query.svc_code + '&is_download=true'
+                      + '&cp_id=' +  this.$route.query.cp_id + '&doc=' + this.$route.query.doc + '&layout_id='
+                      + this.$route.query.layout_id + '&data_id=' + this.$route.query.data_id+'&uuid='+this.$route.query.uuid
+
+                    this.$copyText(url).then(function (e) {
+                      console.log('复制成功',e);
+                    }, function (e) {
+                      console.log('复制失败',e);
+                      this.copyIcon='ios-close-circle'
+                      this.copyResult='操作失败'
+                      this.copyDesc='复制链接失败,请联系管理员'
+                    })
+                  },
+                  onCancel: () => {
+                    this.loading=false
+                    this.clickCopyCancel=true
+                    this.copyIcon='ios-close-circle'
+                    this.copyResult='操作失败'
+                    this.copyDesc='未复制链接,请返回上一页'
+                  }
+                })
+              }
+            },10000)
+          }
         }else {
           this.$Message.warning(this.$t('W_006'))
         }
       })
-  }
+  },
+
 
 }
 </script>
 
 <style scoped>
 
+.desc{
+  position:absolute;
+  top:58%;
+  width:100%;
+  display:flex;
+  justify-content:center;
+  font-weight:bold;
+  color: black;
+}
+.copy{
+  width: 100%;
+  display: flex;
+  justify-content: center;
+}
+
+.copy-icon{
+  font-size: 100px;
+}
 </style>