Selaa lähdekoodia

Merge branch 'develop_yh22' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh22

lilei 1 vuosi sitten
vanhempi
commit
df06db18d2

+ 25 - 0
src/config/router.config.js

@@ -2214,6 +2214,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/salesOutofStockReport',
+            redirect: '/reportData/salesOutofStockReport/list',
+            name: 'salesOutofStockReport',
+            component: BlankLayout,
+            meta: {
+              title: '销售缺货报表',
+              icon: 'profile'
+              // permission: 'M_salesOutofStockReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'salesOutofStockReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesOutofStockReport/list.vue'),
+                meta: {
+                  title: '销售缺货报表',
+                  icon: 'profile',
+                  hidden: true
+                  // permission: 'M_salesOutofStockReportList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/salesReturnReport',
             redirect: '/reportData/salesReturnReport/index',

+ 179 - 0
src/views/reportData/salesOutofStockReport/detailModal.vue

@@ -0,0 +1,179 @@
+<template>
+  <a-modal
+    centered
+    class="financialPaymentDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="详情"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="70%">
+    <!-- 详情 -->
+    <div class="mainContent">
+      <div class="printBox"><Print :disabled="localDataSource.length==0" :showExport="false" @handlePrint="handlePrint"></Print></div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1" header="基础信息">
+            <a-descriptions :column="3">
+              <a-descriptions-item label="销售单号">{{ (basicInfoData&&basicInfoData.allocationLinkagePutNo) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+        <a-alert type="info" style="margin: 10px 0">
+          <div slot="message">
+            缺货总款数 <strong>{{ (basicInfoData&&(basicInfoData.productTotalCategory || basicInfoData.productTotalCategory==0)) ? basicInfoData.productTotalCategory : '--' }}</strong> ,
+            缺货总数量 <strong>{{ (basicInfoData&&(basicInfoData.productTotalQty || basicInfoData.productTotalQty==0)) ? basicInfoData.productTotalQty : '--' }}</strong>
+            ,缺货总售价<strong>{{ (basicInfoData&&(basicInfoData.productTotalCost || basicInfoData.productTotalCost==0)) ? toThousands(basicInfoData.productTotalCost,2) : '--' }}</strong>
+          </div>
+        </a-alert>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 仓库仓位 -->
+          <template slot="warehouse" slot-scope="text, record, index">
+            <a-cascader
+              size="small"
+              @change="e => changeWarehouseCascade(e, record, index)"
+              v-model="record.warehouseCascade"
+              expand-trigger="hover"
+              :allowClear="false"
+              :options="warehouseCascadeData"
+              :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
+              id="chainTransferInEdit-warehouseCascade"
+              placeholder="请选择仓库仓位"
+              style="width: 100%;" />
+          </template>
+        </s-table>
+      </a-spin>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { findPayDetail } from '@/api/settlePay.js'
+import { STable } from '@/components'
+import Print from '@/views/common/print.vue'
+import { getOperationalPrecision } from '@/libs/tools.js'
+import { hdPrint } from '@/libs/JGPrint'
+export default {
+  name: 'FinancialPaymentDetailModal',
+  mixins: [commonMixin],
+  components: { STable, Print },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '缺货数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货金额', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      localDataSource: [],
+      loadData: parameter => {
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam, { allocationLinkagePutSn: this.$route.params.sn })
+        return allocLinkagePutDetailList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getDetailCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              const warehouseSn = data.list[i].warehouseSn || undefined
+              const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
+              data.list[i].warehouseSnBackups = warehouseSn
+              data.list[i].warehouseLocationSnBackups = warehouseLocationSn
+              if (warehouseSn || warehouseLocationSn) {
+                data.list[i].warehouseCascade = [warehouseSn, warehouseLocationSn]
+              } else {
+                data.list[i].warehouseCascade = undefined
+              }
+              // 成本小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].costSubtotal = getOperationalPrecision(data.list[i].putCost, data.list[i].putQty)
+            }
+            this.localDataSource = data.list || []
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 打印预览/快捷打印
+    handlePrint (type, printerType) {
+      const _this = this
+      _this.spinning = true
+      const url = allocLinkagePutDetailPrint
+      const params = { sn: this.$route.params.sn, type: printerType, showFlag: this.$hasPermissions('M_ShowAllCost') ? 1 : 0 }
+      // 打印或导出
+      hdPrint(printerType, type, url, params, '连锁调入单', function () {
+        _this.spinning = false
+      })
+    },
+    //  获取详情
+    getDetail (id) {
+      findPayDetail({ id: id }).then(res => {
+        if (res.status == 200) {
+          this.detailsData = res.data
+        } else {
+          this.detailsData = null
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.detailsData = null
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .financialPaymentDetail-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    .printBox{
+      width:100%;
+      text-align:right;
+      margin-bottom:10px;
+    }
+  }
+</style>

+ 228 - 0
src/views/reportData/salesOutofStockReport/list.vue

@@ -0,0 +1,228 @@
+<template>
+  <div class="jg-page-wrap customerReportList-wrap">
+    <a-card size="small" :bordered="false" class="table-page-search-wrapper">
+      <!-- 搜索条件 -->
+      <a-form-model
+        id="salesReturnReportList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="创建时间" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="客户名称">
+              <custList id="salesReturnReportList-buyerName" ref="custSatelliteList" @change="custSatelliteChange"></custList>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnReportList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnReportList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-success"
+            @click="handleDetail(record)"
+          >详情</a-button>
+        </template>
+      </s-table>
+      </a-spin>
+    </a-card>
+    <!-- 详情 -->
+    <detail-modal :openModal="openDetailModal" ref="detailModal" @close="openDetailModal = false" />
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import custList from '@/views/common/custList.vue'
+import detailModal from './detailModal.vue'
+import { reportSalesReturnPageList, reportSalesReturnBillTotal, reportSalesReturnExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, custList, detailModal },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        buyerNameCurrent: undefined, // 客户名称
+        buyerSnCurrent: undefined, // 客户sn
+        salesReturnNo: ''
+      },
+      openDetailModal: true,
+      rules: {
+        'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.time
+        return reportSalesReturnPageList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].inStockQty = data.list[i].totalQty
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null //  合计
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesReturnNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '缺货次数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货金额', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 查看详情
+    handleDetail (row) {
+      this.openDetailModal = true
+    },
+    // 合计
+    getCount (params) {
+      reportSalesReturnBillTotal(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    custSatelliteChange (v, row) {
+      if (row && row.customerSn) {
+        this.queryParam.buyerSnCurrent = row.customerSn
+        this.queryParam.buyerNameCurrent = undefined
+      } else {
+        this.queryParam.buyerNameCurrent = v
+        this.queryParam.buyerSnCurrent = undefined
+      }
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.salesReturnNo = ''
+      this.queryParam.buyerNameCurrent = undefined
+      this.queryParam.buyerSnCurrent = undefined
+      this.$refs.custSatelliteList.resetForm()
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    // 导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
+          _this.exportLoading = true
+          _this.spinning = true
+          reportSalesReturnExport(params).then(res => {
+            downloadExcel(res, '销售退货报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    pageInit () {}
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>