فهرست منبع

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

# Conflicts:
#	public/version.json
#	src/views/chainReportData/chainSalesDetailReport/list.vue
#	src/views/chainReportData/chainSalesReport/list.vue
#	src/views/reportData/salesDetailReport/list.vue
#	src/views/reportData/salesReport/list.vue
#	src/views/salesManagement/productPricing/productSalesRecordModal.vue
#	vue.config.js
解决冲突
lilei 3 سال پیش
والد
کامیت
22ddc75cb6

+ 6 - 0
package-lock.json

@@ -17373,6 +17373,12 @@
       "integrity": "sha512-nCxEZUXfI+DYrdI05wGrKAuO24weIzpn2Emwssm8Yzlw0Q1i1C8xTdFaf8dz60OVgpxy8oPMlfo4pR7UvxLPCQ==",
       "dev": true
     },
+    "webpack-version-plugin": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/webpack-version-plugin/-/webpack-version-plugin-2.0.3.tgz",
+      "integrity": "sha512-sjM2spMYLSK7tTZ0v0sW6UlazJGWeoS4vOYTFMY+GFJiJ9Dv573Ueg94IYffsTLq0g3zgC29v0NHJgkkSemofA==",
+      "dev": true
+    },
     "websocket-driver": {
       "version": "0.7.3",
       "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz",

+ 2 - 1
package.json

@@ -71,7 +71,8 @@
     "vue-svg-icon-loader": "^2.1.1",
     "vue-template-compiler": "^2.6.10",
     "webpack-bundle-analyzer": "^4.5.0",
-    "webpack-theme-color-replacer": "^1.2.17"
+    "webpack-theme-color-replacer": "^1.2.17",
+    "webpack-version-plugin": "^2.0.3"
   },
   "eslintConfig": {
     "root": true,

+ 3 - 2
public/version.json

@@ -1,4 +1,5 @@
 {
-    "version": "1.1.7",
-    "message": "发现有新版本发布,确定更新系统?"
+  "message": "发现有新版本发布,确定更新系统?",
+  "vendorJsVersion": "",
+  "version": 1653386104693
 }

+ 115 - 0
src/api/reportData.js

@@ -1,4 +1,119 @@
 import { axios } from '@/utils/request'
+// 散件退货-分页列表
+export const reportSparePartsReturnPageList = (params) => {
+  const url = `report/reportSparePartsReturn/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 散件退货-列表合计
+export const reportSparePartsReturnTotal = (params) => {
+  return axios({
+    url: 'report/reportSparePartsReturn/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 散件退货-报表导出
+export const reportSparePartsReturnExport = params => {
+  return axios.request({
+    url: `/report/reportSparePartsReturn/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+ 
+// 散件退货明细--分页
+export const reportSparePartsReturnDetailPageList = (params) => {
+  const url = `report/reportSparePartsReturnDetail/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 散件退货明细-列表合计
+export const reportSparePartsReturnDetailTotal = (params) => {
+  return axios({
+    url: 'report/reportSparePartsReturnDetail/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 散件退货明细-报表导出
+export const reportSparePartsReturnDetailExport = params => {
+  return axios.request({
+    url: `/report/reportSparePartsReturnDetail/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 散件入库-分页列表
+export const reportBlukPageList = (params) => {
+  const url = `report/reportSparePartsPurchase/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 散件入库-列表合计
+export const reportBlukTotal = (params) => {
+  return axios({
+    url: 'report/reportSparePartsPurchase/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 散件入库-报表导出
+export const reportBlukExport = params => {
+  return axios.request({
+    url: `/report/reportSparePartsPurchase/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 散件入库详细-分页列表
+export const reportBlukDetailPageList = (params) => {
+  const url = `report/reportSparePartsPurchaseDetail/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 散件入库详细-列表合计
+export const reportBlukDetailTotal = (params) => {
+  return axios({
+    url: 'report/reportSparePartsPurchaseDetail/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 散件入库详细-报表导出
+export const reportBlukDetailExport = params => {
+  return axios.request({
+    url: `/report/reportSparePartsPurchaseDetail/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 
 // 销售退货-分页列表
 export const reportSalesReturnPageList = (params) => {

+ 8 - 14
src/config/router.config.js

@@ -1931,7 +1931,7 @@ export const asyncRouterMap = [
             meta: {
               title: '销售退货报表',
               icon: 'profile',
-              // permission: 'M_salesReturnReportList,M_salesReturnDetailReportList'
+              // permission: 'M_salesReturnReportList'
             },
             hideChildrenInMenu: true,
             children: [
@@ -1943,7 +1943,7 @@ export const asyncRouterMap = [
                   title: '销售退货报表',
                   icon: 'profile',
                   hidden: true,
-                  // permission: 'M_salesReturnReportList,M_salesReturnDetailReportList'
+                  // permission: 'M_salesReturnReportList'
                 }
               },
               {
@@ -2128,7 +2128,7 @@ export const asyncRouterMap = [
             meta: {
               title: '散件入库报表',
               icon: 'profile',
-              // permission: 'M_bulkWarehousingReportList,M_bulkWarehousingDetailReportList'
+              // permission: 'M_bulkWarehousingReportList'
             },
             hideChildrenInMenu: true,
             children: [
@@ -2140,7 +2140,7 @@ export const asyncRouterMap = [
                   title: '散件入库报表',
                   icon: 'profile',
                   hidden: true,
-                  // permission: 'M_bulkWarehousingReportList,M_bulkWarehousingDetailReportList'
+                  // permission: 'M_bulkWarehousingReportList'
                 }
               },
               {
@@ -2151,7 +2151,6 @@ export const asyncRouterMap = [
                   title: '散件入库报表列表',
                   icon: 'profile',
                   hidden: true,
-                  permission: 'M_bulkWarehousingReportList'
                 }
               },
               {
@@ -2162,7 +2161,6 @@ export const asyncRouterMap = [
                   title: '散件入库明细报表列表',
                   icon: 'profile',
                   hidden: true,
-                  permission: 'M_bulkWarehousingDetailReportList'
                 }
               }
             ]
@@ -2175,7 +2173,7 @@ export const asyncRouterMap = [
             meta: {
               title: '散件退货报表',
               icon: 'profile',
-              // permission: 'M_bulkReturnReportList,M_bulkReturnDetailReportList'
+              // permission: 'M_bulkReturnReportList'
             },
             hideChildrenInMenu: true,
             children: [
@@ -2187,7 +2185,7 @@ export const asyncRouterMap = [
                   title: '散件退货报表',
                   icon: 'profile',
                   hidden: true,
-                  // permission: 'M_bulkWarehousingReportList,M_bulkWarehousingDetailReportList'
+                  // permission: 'M_bulkReturnReportList'
                 }
               },
               {
@@ -2198,7 +2196,6 @@ export const asyncRouterMap = [
                   title: '散件退货报表列表',
                   icon: 'profile',
                   hidden: true,
-                  permission: 'M_bulkReturnReportList'
                 }
               },
               {
@@ -2209,7 +2206,6 @@ export const asyncRouterMap = [
                   title: '散件退货明细报表列表',
                   icon: 'profile',
                   hidden: true,
-                  permission: 'M_bulkReturnDetailReportList'
                 }
               }
             ]
@@ -2222,7 +2218,7 @@ export const asyncRouterMap = [
             meta: {
               title: '店内调出报表',
               icon: 'profile',
-              // permission: 'M_storeTransferOutReportList,M_storeTransferOutDetailReportList'
+              // permission: 'M_storeTransferOutReportList'
             },
             hideChildrenInMenu: true,
             children: [
@@ -2234,7 +2230,7 @@ export const asyncRouterMap = [
                   title: '店内调出报表',
                   icon: 'profile',
                   hidden: true,
-                  // permission: 'M_bulkWarehousingReportList,M_bulkWarehousingDetailReportList'
+                  // permission: 'M_storeTransferOutReportList'
                 }
               },
               {
@@ -2245,7 +2241,6 @@ export const asyncRouterMap = [
                   title: '店内调出报表列表',
                   icon: 'profile',
                   hidden: true,
-                  permission: 'M_storeTransferOutReportList'
                 }
               },
               {
@@ -2256,7 +2251,6 @@ export const asyncRouterMap = [
                   title: '店内调出明细报表列表',
                   icon: 'profile',
                   hidden: true,
-                  permission: 'M_storeTransferOutDetailReportList'
                 }
               }
             ]

+ 3 - 1
src/libs/versionUpdate.js

@@ -7,7 +7,9 @@ const isNewVersion = () => {
       const vueVersion = res.data.version
       const message = res.data.message
       const localVueVersion = localStorage.getItem('vueVersion-iscm')
-      if (localVueVersion && localVueVersion != vueVersion) {
+      // 生产环境不比对版本号
+      const production = process.env.NODE_ENV === 'production'
+      if (localVueVersion && localVueVersion != vueVersion && production) {
         localStorage.setItem('vueVersion-iscm', vueVersion)
         modal.info({
           title: '提示',

+ 15 - 16
src/views/reportData/bulkReturnReport/detailList.vue

@@ -20,7 +20,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="散件退货单号">
-              <a-input id="bulkInList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
+              <a-input id="bulkInList-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入单号"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -63,7 +63,7 @@
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
-              v-if="$hasPermissions('B_salesDetailExport')"
+              v-if="$hasPermissions('M_bulkReturnReportExport')"
               class="button-warning"
               id="bulkInList-export-btn">导出</a-button>
             <a @click="advanced=!advanced" style="margin-left: 5px">
@@ -77,8 +77,8 @@
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
-        产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        退货总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        产品总数量:<strong>{{ (totalData && (totalData.purchaseQty || totalData.purchaseQty==0)) ? totalData.purchaseQty : '--' }}</strong>;
+        退货总成本:<strong>{{ (totalData && (totalData.purchaseTotalCost || totalData.purchaseTotalCost==0)) ? '¥'+totalData.purchaseTotalCost : '--' }}</strong>;
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -103,7 +103,7 @@ import { downloadExcel } from '@/libs/JGPrint.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import supplier from '@/views/common/supplier'
-import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillDetailExport } from '@/api/reportData'
+import { reportSparePartsReturnDetailPageList, reportSparePartsReturnDetailTotal, reportSparePartsReturnDetailExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, ProductType, ProductBrand, supplier },
   mixins: [commonMixin],
@@ -130,8 +130,7 @@ export default {
           name: '' //  产品名称
         },
         productType: undefined,
-        salesBillNo: '',
-        salesManName: ''
+        sparePartsReturnNo: ''
       },
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
@@ -140,14 +139,14 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '散件退货单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '散件退货单号', dataIndex: 'sparePartsReturnNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'supplierName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '数量', dataIndex: 'purchaseQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本', dataIndex: 'purchaseTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -156,7 +155,7 @@ export default {
         this.spinning = true
         delete params.time
         delete params.warehouseCascade
-        return reportSalesBillDetailList(params).then(res => {
+        return reportSparePartsReturnDetailPageList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -179,7 +178,7 @@ export default {
   methods: {
     // 合计
     getCount (params) {
-      reportSalesBillDetailCount(params).then(res => {
+      reportSparePartsReturnDetailTotal(params).then(res => {
         if (res.status == 200) {
           this.totalData = res.data
         } else {
@@ -210,7 +209,7 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.salesBillNo = ''
+      this.queryParam.sparePartsReturnNo = ''
       this.queryParam.salesTargetName = ''
       this.queryParam.sparePartsPutTypeSn = undefined
       this.queryParam.supplierSn = undefined
@@ -232,7 +231,7 @@ export default {
           const params = _this.queryParam
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesBillDetailExport(params).then(res => {
+          reportSparePartsReturnDetailExport(params).then(res => {
             downloadExcel(res, '散件入库明细报表')
             _this.exportLoading = false
             _this.spinning = false

+ 4 - 4
src/views/reportData/bulkReturnReport/index.vue

@@ -2,13 +2,13 @@
   <div class="tabsReportList-wrap">
     <div style="background-color: #fff;margin-bottom: 5px;">
       <a-tabs default-active-key="1" v-model="curTab">
-        <a-tab-pane key="1" tab="散件退货报表" v-if="$hasPermissions('M_salesReportList')"></a-tab-pane>
-        <a-tab-pane key="2" tab="散件退货明细报表" v-if="$hasPermissions('M_salesDetailReportList')" force-render></a-tab-pane>
+        <a-tab-pane key="1" tab="散件退货报表"></a-tab-pane>
+        <a-tab-pane key="2" tab="散件退货明细报表" force-render></a-tab-pane>
       </a-tabs>
     </div>
     <a-card size="small" :bordered="false">
-      <report v-show="curTab==1&&$hasPermissions('M_salesReportList')"></report>
-      <detailReport v-show="curTab==2&&$hasPermissions('M_salesDetailReportList')"></detailReport>
+      <report v-show="curTab==1"></report>
+      <detailReport v-show="curTab==2"></detailReport>
     </a-card>
   </div>
 </template>

+ 17 - 21
src/views/reportData/bulkReturnReport/list.vue

@@ -20,7 +20,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="散件退货单号">
-              <a-input id="bulkReturn-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
+              <a-input id="bulkReturn-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入单号"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -41,7 +41,7 @@
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
-              v-if="$hasPermissions('B_salesReportExport')"
+              v-if="$hasPermissions('M_bulkReturnReportExport')"
               class="button-warning"
               id="bulkReturn-export-btn">导出</a-button>
           </a-col>
@@ -52,8 +52,8 @@
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
         总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
-        产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        退货总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        产品总数量:<strong>{{ (totalData && (totalData.productTotalQty || totalData.productTotalQty==0)) ? totalData.productTotalQty : '--' }}</strong>;
+        退货总成本:<strong>{{ (totalData && (totalData.productTotalCost || totalData.productTotalCost==0)) ? '¥'+totalData.productTotalCost : '--' }}</strong>;
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -76,7 +76,7 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import supplier from '@/views/common/supplier'
-import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
+import { reportSparePartsReturnPageList, reportSparePartsReturnTotal, reportSparePartsReturnExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, supplier },
   mixins: [commonMixin],
@@ -91,10 +91,8 @@ export default {
         time: [],
         beginDate: '',
         endDate: '',
-        sparePartsPutTypeSn: undefined,
         supplierSn: undefined,
-        salesBillNo: '',
-        salesManName: ''
+        sparePartsReturnNo: ''
       },
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
@@ -103,12 +101,12 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '散件退货单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'salesTargetName', width: '15%', align: 'center', 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: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '散件退货单号', dataIndex: 'sparePartsReturnNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'supplierName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '款数', dataIndex: 'productTotalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'productTotalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本', dataIndex: 'productTotalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -116,7 +114,7 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         delete params.time
-        return reportSalesBillList(params).then(res => {
+        return reportSparePartsReturnPageList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -138,7 +136,7 @@ export default {
   methods: {
     // 合计
     getCount (params) {
-      reportSalesBillCount(params).then(res => {
+      reportSparePartsReturnTotal(params).then(res => {
         if (res.status == 200) {
           this.totalData = res.data
         } else {
@@ -169,10 +167,8 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.salesTargetType = undefined
-      this.queryParam.sparePartsPutTypeSn = undefined
-      this.queryParam.salesBillNo = ''
-      this.queryParam.salesManName = ''
+      this.queryParam.supplierSn = undefined
+      this.queryParam.sparePartsReturnNo = ''
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
@@ -185,7 +181,7 @@ export default {
           const params = _this.queryParam
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesBillExport(params).then(res => {
+          reportSparePartsReturnExport(params).then(res => {
             downloadExcel(res, '散件退货报表')
             _this.exportLoading = false
             _this.spinning = false

+ 16 - 17
src/views/reportData/bulkWarehousingReport/detailList.vue

@@ -20,7 +20,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="散件单号">
-              <a-input id="bulkInList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
+              <a-input id="bulkInList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入单号"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -70,7 +70,7 @@
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
-              v-if="$hasPermissions('B_salesDetailExport')"
+              v-if="$hasPermissions('M_bulkWarehousingReportExport')"
               class="button-warning"
               id="bulkInList-export-btn">导出</a-button>
             <a @click="advanced=!advanced" style="margin-left: 5px">
@@ -84,8 +84,8 @@
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
-        产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        散件总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        产品总数量:<strong>{{ (totalData && (totalData.putQty || totalData.putQty==0)) ? totalData.putQty : '--' }}</strong>;
+        散件总成本:<strong>{{ (totalData && (totalData.putTotalCost || totalData.putTotalCost==0)) ? '¥'+totalData.putTotalCost : '--' }}</strong>;
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -111,7 +111,7 @@ import { sparePartsPutTypeAllList } from '@/api/sparePartsPutType'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import supplier from '@/views/common/supplier'
-import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillDetailExport } from '@/api/reportData'
+import { reportBlukDetailPageList, reportBlukDetailTotal, reportBlukDetailExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, ProductType, ProductBrand, supplier },
   mixins: [commonMixin],
@@ -138,7 +138,7 @@ export default {
           name: '' //  产品名称
         },
         productType: undefined,
-        salesBillNo: '',
+        sparePartsPurchaseNo: '',
         salesManName: ''
       },
       rules: {
@@ -148,15 +148,15 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '散件单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '散件入库类型', dataIndex: 'settleStyleName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '散件单号', dataIndex: 'sparePartsPurchaseNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'supplierName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '散件入库类型', dataIndex: 'sparePartsTypeName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '数量', dataIndex: 'putQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本', dataIndex: 'putTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -165,7 +165,7 @@ export default {
         this.spinning = true
         delete params.time
         delete params.warehouseCascade
-        return reportSalesBillDetailList(params).then(res => {
+        return reportBlukDetailPageList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -188,7 +188,7 @@ export default {
   methods: {
     // 合计
     getCount (params) {
-      reportSalesBillDetailCount(params).then(res => {
+      reportBlukDetailTotal(params).then(res => {
         if (res.status == 200) {
           this.totalData = res.data
         } else {
@@ -219,8 +219,7 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.salesBillNo = ''
-      this.queryParam.salesTargetName = ''
+      this.queryParam.sparePartsPurchaseNo = ''
       this.queryParam.sparePartsPutTypeSn = undefined
       this.queryParam.supplierSn = undefined
       this.queryParam.productEntity.productBrandSn = undefined
@@ -241,7 +240,7 @@ export default {
           const params = _this.queryParam
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesBillDetailExport(params).then(res => {
+          reportBlukDetailExport(params).then(res => {
             downloadExcel(res, '散件入库明细报表')
             _this.exportLoading = false
             _this.spinning = false

+ 4 - 4
src/views/reportData/bulkWarehousingReport/index.vue

@@ -2,13 +2,13 @@
   <div class="tabsReportList-wrap">
     <div style="background-color: #fff;margin-bottom: 5px;">
       <a-tabs default-active-key="1" v-model="curTab">
-        <a-tab-pane key="1" tab="散件入库报表" v-if="$hasPermissions('M_salesReportList')"></a-tab-pane>
-        <a-tab-pane key="2" tab="散件入库明细报表" v-if="$hasPermissions('M_salesDetailReportList')" force-render></a-tab-pane>
+        <a-tab-pane key="1" tab="散件入库报表"></a-tab-pane>
+        <a-tab-pane key="2" tab="散件入库明细报表" force-render></a-tab-pane>
       </a-tabs>
     </div>
     <a-card size="small" :bordered="false">
-      <report v-show="curTab==1&&$hasPermissions('M_salesReportList')"></report>
-      <detailReport v-show="curTab==2&&$hasPermissions('M_salesDetailReportList')"></detailReport>
+      <report v-show="curTab==1"></report>
+      <detailReport v-show="curTab==2"></detailReport>
     </a-card>
   </div>
 </template>

+ 22 - 22
src/views/reportData/bulkWarehousingReport/list.vue

@@ -20,7 +20,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="散件单号">
-              <a-input id="bulkIn-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
+              <a-input id="bulkIn-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入单号"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -50,7 +50,7 @@
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
-              v-if="$hasPermissions('B_salesReportExport')"
+              v-if="$hasPermissions('M_bulkWarehousingReportExport')"
               class="button-warning"
               id="bulkIn-export-btn">导出</a-button>
             <a @click="advanced=!advanced" style="margin-left: 5px">
@@ -65,8 +65,8 @@
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
         总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
-        产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        散件总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        产品总数量:<strong>{{ (totalData && (totalData.productTotalQty || totalData.productTotalQty==0)) ? totalData.productTotalQty : '--' }}</strong>;
+        散件总成本:<strong>{{ (totalData && (totalData.productTotalCost || totalData.productTotalCost==0)) ? '¥'+totalData.productTotalCost : '--' }}</strong>;
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -90,7 +90,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import { sparePartsPutTypeAllList } from '@/api/sparePartsPutType'
 import supplier from '@/views/common/supplier'
-import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
+import { reportBlukPageList, reportBlukTotal, reportBlukExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, supplier },
   mixins: [commonMixin],
@@ -105,10 +105,10 @@ export default {
         time: [],
         beginDate: '',
         endDate: '',
-        sparePartsPutTypeSn: undefined,
+        sparePartsType: undefined,
         supplierSn: undefined,
-        salesBillNo: '',
-        salesManName: ''
+        sparePartsPurchaseNo: '',
+        supplierName: ''
       },
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
@@ -117,13 +117,13 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '散件单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '散件入库类型', dataIndex: 'settleStyleName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { 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: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '散件单号', dataIndex: 'sparePartsPurchaseNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'supplierName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '散件入库类型', dataIndex: 'sparePartsTypeName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '款数', dataIndex: 'productTotalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'productTotalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本', dataIndex: 'productTotalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -131,7 +131,7 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         delete params.time
-        return reportSalesBillList(params).then(res => {
+        return reportBlukPageList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -154,7 +154,7 @@ export default {
   methods: {
     // 合计
     getCount (params) {
-      reportSalesBillCount(params).then(res => {
+      reportBlukTotal(params).then(res => {
         if (res.status == 200) {
           this.totalData = res.data
         } else {
@@ -185,10 +185,10 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.salesTargetType = undefined
-      this.queryParam.sparePartsPutTypeSn = undefined
-      this.queryParam.salesBillNo = ''
-      this.queryParam.salesManName = ''
+      this.queryParam.supplierSn = undefined
+      this.queryParam.sparePartsType = undefined
+      this.queryParam.sparePartsPurchaseNo = ''
+      this.queryParam.supplierName = ''
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
@@ -201,7 +201,7 @@ export default {
           const params = _this.queryParam
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesBillExport(params).then(res => {
+          reportBlukExport(params).then(res => {
             downloadExcel(res, '散件入库报表')
             _this.exportLoading = false
             _this.spinning = false

+ 1 - 1
src/views/reportData/purchaseReceiptReport/list.vue

@@ -2,7 +2,7 @@
   <a-card size="small" :bordered="false" class="purchaseReceiptReportList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 标签页 -->
-      <a-tabs type="card" :default-active-key="nowKey" @change="handleTabChange" class="purchaseReceiptReportList-tabs ">
+      <a-tabs :default-active-key="nowKey" @change="handleTabChange" class="purchaseReceiptReportList-tabs ">
         <a-tab-pane v-for="item in tabPaneData" :key="item.val">
           <span slot="tab">{{ item.name }}</span>
         </a-tab-pane>

+ 1 - 1
src/views/reportData/salesReturnReport/detailList.vue

@@ -59,7 +59,7 @@
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
-              v-if="$hasPermissions('B_salesDetailExport')"
+              v-if="$hasPermissions('M_salesReturnReportExport')"
               class="button-warning"
               id="salesDetailReportList-export-btn">导出</a-button>
             <a @click="advanced=!advanced" style="margin-left: 5px">

+ 4 - 4
src/views/reportData/salesReturnReport/index.vue

@@ -2,13 +2,13 @@
   <div class="tabsReportList-wrap">
     <div style="background-color: #fff;margin-bottom: 5px;">
       <a-tabs default-active-key="1" v-model="curTab">
-        <a-tab-pane key="1" tab="销售退货报表" v-if="$hasPermissions('M_salesReportList')"></a-tab-pane>
-        <a-tab-pane key="2" tab="销售退货明细报表" v-if="$hasPermissions('M_salesDetailReportList')" force-render></a-tab-pane>
+        <a-tab-pane key="1" tab="销售退货报表"></a-tab-pane>
+        <a-tab-pane key="2" tab="销售退货明细报表" force-render></a-tab-pane>
       </a-tabs>
     </div>
     <a-card size="small" :bordered="false">
-      <report v-show="curTab==1&&$hasPermissions('M_salesReportList')"></report>
-      <detailReport v-show="curTab==2&&$hasPermissions('M_salesDetailReportList')"></detailReport>
+      <report v-show="curTab==1"></report>
+      <detailReport v-show="curTab==2"></detailReport>
     </a-card>
   </div>
 </template>

+ 1 - 1
src/views/reportData/salesReturnReport/list.vue

@@ -37,7 +37,7 @@
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
-              v-if="$hasPermissions('B_salesReportExport')"
+              v-if="$hasPermissions('M_salesReturnReportExport')"
               class="button-warning"
               id="salesReturnReportList-export-btn">导出</a-button>
           </a-col>

+ 1 - 1
src/views/reportData/storeTransferOutReport/detailList.vue

@@ -66,7 +66,7 @@
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
-              v-if="$hasPermissions('B_salesDetailExport')"
+              v-if="$hasPermissions('M_storeTransferOutReportExport')"
               class="button-warning"
               id="storeTransOutDetailReport-export-btn">导出</a-button>
             <a @click="advanced=!advanced" style="margin-left: 5px">

+ 4 - 4
src/views/reportData/storeTransferOutReport/index.vue

@@ -2,13 +2,13 @@
   <div class="tabsReportList-wrap">
     <div style="background-color: #fff;margin-bottom: 5px;">
       <a-tabs default-active-key="1" v-model="curTab">
-        <a-tab-pane key="1" tab="店内调出报表" v-if="$hasPermissions('M_salesReportList')"></a-tab-pane>
-        <a-tab-pane key="2" tab="店内调出明细报表" v-if="$hasPermissions('M_salesDetailReportList')" force-render></a-tab-pane>
+        <a-tab-pane key="1" tab="店内调出报表"></a-tab-pane>
+        <a-tab-pane key="2" tab="店内调出明细报表" force-render></a-tab-pane>
       </a-tabs>
     </div>
     <a-card size="small" :bordered="false">
-      <report v-show="curTab==1&&$hasPermissions('M_salesReportList')"></report>
-      <detailReport v-show="curTab==2&&$hasPermissions('M_salesDetailReportList')"></detailReport>
+      <report v-show="curTab==1"></report>
+      <detailReport v-show="curTab==2"></detailReport>
     </a-card>
   </div>
 </template>

+ 1 - 1
src/views/reportData/storeTransferOutReport/list.vue

@@ -44,7 +44,7 @@
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"
-              v-if="$hasPermissions('B_salesReportExport')"
+              v-if="$hasPermissions('M_storeTransferOutReportExport')"
               class="button-warning"
               id="storeTransOutReport-export-btn">导出</a-button>
           </a-col>

+ 177 - 0
src/views/salesManagement/productPricing/productSalesRecordModal.vue

@@ -0,0 +1,177 @@
+<template>
+  <div v-if="isShow">
+    <a-modal
+      centered
+      class="salesRecord-price-modal"
+      :footer="null"
+      :maskClosable="false"
+      :title="modalTit"
+      v-model="isShow"
+      @cancle="isShow=false"
+      :width="960">
+      <div>
+        <div v-if="baseData" style="line-height: 28px;margin-bottom: 10px;">
+          <div>产品编码:{{ baseData.code }}</div>
+          <div>产品名称:{{ baseData.name }}</div>
+        </div>
+        <div style="display: flex;padding-bottom: 15px;align-items: center;">
+          <span>选择客户:</span>
+          <div style="width: 40%;"><custList ref="custList" @change="custChange" placeholder="输入客户名称搜索" v-model="queryParam.buyerSn"></custList></div>
+          <div style="padding: 0 15px;color: #999;">
+            <a-button type="primary" @click="handelSearch(1)">查询</a-button>
+            <a-button type="default" style="margin-left: 5px" @click="reset">重置</a-button>
+          </div>
+        </div>
+        <!-- 表格 -->
+        <a-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :dataSource="list"
+          :loading="loading"
+          :pagination="false"
+          bordered>
+        </a-table>
+        <!-- 分页 -->
+        <tablePagination
+          ref="tablePagination"
+          :total="paginationProps.total"
+          :current="paginationProps.current"
+          :pageSize="paginationProps.pageSize"
+          @changePageSize="changePageSize"
+          @changePage="changePage" />
+      </div>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { salesRecordlList } from '@/api/salesDetail.js'
+import { STable } from '@/components'
+import tablePagination from '@/views/common/tablePagination.vue'
+import custList from '@/views/common/custList.vue'
+export default {
+  name: 'SalesRecordModal',
+  components: { STable, tablePagination, custList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  computed: {
+    modalTit () {
+      return '销售记录'
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      queryParam: {
+        productSn: null,
+        buyerSn: undefined
+      },
+      // 表头
+      columns: [
+        { title: '销售时间', dataIndex: 'salesBillEntity.createDate', width: 250, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售价(¥)', dataIndex: 'price', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', dataIndex: 'qty', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'salesBillEntity.buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ],
+      list: [],
+      loading: false,
+      paginationProps: {
+        total: 0, //  分页总条数
+        current: 1,
+        pageSize: 20
+      },
+      baseData: null
+    }
+  },
+  methods: {
+    reset () {
+      this.queryParam.buyerSn = undefined
+      this.$refs.custList.setData(undefined)
+      this.getDetail(this.baseData)
+    },
+    // 客户 change
+    custChange (obj) {
+      this.queryParam.buyerSn = obj.key || undefined
+    },
+    //  获取详情
+    getDetail (row) {
+      this.queryParam.productSn = row.productSn
+      this.handelSearch(1)
+      this.baseData = row
+    },
+    // 查询列表
+    handelSearch (pageNo) {
+      this.paginationProps.current = pageNo || this.paginationProps.current
+      const params = {
+        pageNo: this.paginationProps.current,
+        pageSize: this.paginationProps.pageSize
+      }
+      // 开始查询
+      this.loading = true
+      salesRecordlList({ ...params, ...this.queryParam }).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          const data = res.data
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.current = data.pageNo
+          this.list = data.list
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.paginationProps.pageSize = 20
+          this.list = []
+        }
+      })
+    },
+    //  分页  一页多少条change
+    changePageSize (current, pageSize) {
+      this.paginationProps.current = current
+      this.paginationProps.pageSize = pageSize
+      this.handelSearch()
+    },
+    //  分页 页码change
+    changePage (current) {
+      this.paginationProps.current = current
+      this.handelSearch()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paginationProps.total = 0
+        this.paginationProps.current = 1
+        this.paginationProps.pageSize = 20
+        this.curTab = '1'
+        this.list = []
+        this.queryParam.buyerSn = undefined
+        this.$refs.custList.setData(undefined)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .salesRecord-price-modal{
+    .ant-modal-body {
+      padding: 20px;
+    }
+  }
+</style>

+ 18 - 2
vue.config.js

@@ -1,3 +1,4 @@
+const fs = require('fs');
 const path = require('path')
 const webpack = require('webpack')
 const createThemeColorReplacerPlugin = require('./config/plugin.config')
@@ -5,6 +6,9 @@ const createThemeColorReplacerPlugin = require('./config/plugin.config')
 const compressionWebpackPlugin = require('compression-webpack-plugin');
 // js,css 压缩
 const TerserPlugin = require('terser-webpack-plugin');
+// 版本自动生成
+const WebpackVersionPlugin = require('webpack-version-plugin');
+const versionConfig = require(resolve('public/version.json'));
 
 function resolve (dir) {
   return path.join(__dirname, dir)
@@ -89,7 +93,16 @@ const vueConfig = {
           threshold: 10240,
           //只有压缩率小于这个值的资源才会被处理。默认值是 0.8。
           minRatio: 0.8
-        })
+        }),
+      new WebpackVersionPlugin({
+        // You must set the cb option
+        cb: function(hashMap) {
+          if(!isProd()){
+            versionConfig.version = new Date().getTime();
+            fs.writeFileSync(resolve('./public/version.json'), JSON.stringify(versionConfig, null, 2)); 
+          }
+        }
+      })
     ],
     // if prod is on, add externals
     externals: isProd() ? prodExternals : {}
@@ -198,7 +211,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.105:8503/qpls-md',
+        // target: 'http://192.168.16.156:8076/qpls-md',
         target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,
@@ -207,6 +220,9 @@ const vueConfig = {
           '^/api': ''
         }
       }
+    },
+    watchOptions: {
+        ignored: [/node_modules/, /public/],
     }
   },