Browse Source

注释 id 添加

chenrui 11 months ago
parent
commit
67e8e6a9ad

+ 2 - 0
src/views/productManagement/newProduct/detail.vue

@@ -49,7 +49,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import imgZoom from 'vue2.0-zoom'
+// 接口
 import { productSnDetail } from '@/api/product.js'
 export default {
   name: 'ViewProduct',

+ 31 - 22
src/views/productManagement/newProduct/list.vue

@@ -1,45 +1,45 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="productInfoList-wrap searchBoxNormal">
+    <a-card size="small" :bordered="false" class="newProductList-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="newProductList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品编码">
-                <a-input id="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+                <a-input id="newProductList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品名称">
-                <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+                <a-input id="newProductList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item :label="($route.params.onlineFalg=='1'?'上':'下')+'线时间'">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="newProductList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品品牌">
-                  <ProductBrand id="productInfoList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                  <ProductBrand id="newProductList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品分类">
-                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="productInfoList-productType"></productTypeAll>
+                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="newProductList-productType"></productTypeAll>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="原厂编码">
-                  <a-input id="productInfoList-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
+                  <a-input id="newProductList-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="newProductList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="newProductList-reset">重置</a-button>
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -47,7 +47,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 v-if="$hasPermissions('B_productLaunchInfoExoprt')"
-                id="productInfoList-export">导出</a-button>
+                id="newProductList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -87,7 +87,7 @@
               type="link"
               class="button-success"
               @click="handleDetail(record)"
-              id="productInfoList-detail-btn">详情</a-button>
+              id="newProductList-detail-btn">详情</a-button>
           </template>
         </s-table>
       </a-spin>
@@ -96,14 +96,16 @@
 </template>
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { queryNewProductPage, queryOnlinePageList, productLogExportExcel } from '@/api/product'
+import moment from 'moment'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
 import rangeDate from '@/views/common/rangeDate.vue'
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
+import { queryNewProductPage, queryOnlinePageList, productLogExportExcel } from '@/api/product'
 export default {
   name: 'NewProductList',
   mixins: [commonMixin],
@@ -112,11 +114,13 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      productType: [],
-      queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      productType: [], // 产品分类
+      //  查询条件
+      queryParam: {
+        beginDate: '', // 上下线开始时间
+        endDate: '', // 上下线结束时间
         code: '', //  产品编码
         name: '', //  产品名称
         origCode: '', //  原厂编码
@@ -127,7 +131,7 @@ export default {
         productTypeSn3: '', //  产品三级分类
         enabledFlag: undefined //  状态
       },
-      disabled: false, //  查询、重置按钮是否可操作
+      // 上下线时间查询
       time: [
         moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
@@ -147,6 +151,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // type=='onlineInfo' 获取上线列表数据  type=='unlineInfo' 获取下线列表数据
         const ajaxName = this.$route.params.type == 'onlineInfo' ? queryOnlinePageList : queryNewProductPage
         if (this.$route.params.type == 'onlineInfo') {
           if (this.queryParam.beginDate || this.queryParam.endDate) {
@@ -163,6 +168,7 @@ export default {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -178,7 +184,7 @@ export default {
     }
   },
   methods: {
-    //  创建时间  change
+    //  上下线时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
@@ -195,6 +201,7 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.queryParam.enabledFlag = undefined
       this.productType = []
+      // 上线产品 上线时间初始化
       if (this.$route.params.type == 'onlineInfo') {
         this.$refs.rangeDate.resetDate(this.time)
         this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
@@ -229,12 +236,14 @@ export default {
         _this.spinning = false
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 7 - 2
src/views/productManagement/newProduct/modal.vue

@@ -15,7 +15,7 @@
         bordered>
       </s-table>
       <div style="padding-top: 15px;">
-        <a-button @click="viewMore" block type="primary" ghost>查看更多{{ onlineFalg==1?'新品':'下线产品' }}</a-button>
+        <a-button id="newProduct-modal-btn" @click="viewMore" block type="primary" ghost>查看更多{{ onlineFalg==1?'新品':'下线产品' }}</a-button>
       </div>
     </a-spin>
   </div>
@@ -23,7 +23,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
+// 接口
 import { queryNewProductPage } from '@/api/product'
 export default {
   name: 'NewProductListModal',
@@ -38,14 +40,16 @@ export default {
   data () {
     return {
       spinning: false,
-      queryParam: {},
+      queryParam: {}, // 查询参数
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
+        // 获取表格数据 无分页
         return queryNewProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: this.onlineFalg })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -75,6 +79,7 @@ export default {
     }
   },
   methods: {
+    // 查看更多
     viewMore () {
       this.$emit('seeMore')
     }

+ 24 - 14
src/views/productManagement/priceChangeRecord/list.vue

@@ -3,11 +3,11 @@
     <a-card size="small" :bordered="false" class="productChangeRecordList-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="productChangeRecordList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="变更时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="productChangeRecordList-time" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -79,7 +79,7 @@
           </template>
           <!-- 变更状态 -->
           <span slot="productStatus" slot-scope="text, record">
-            <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.enabledFlag" @change="changeFlagHandle(text, record)"/>
+            <a-switch checkedChildren="启用" id="productChangeRecordList-enabledFlag" unCheckedChildren="禁用" v-model="record.enabledFlag" @change="changeFlagHandle(text, record)"/>
           </span>
           <!-- 省级价变更后 -->
           <template slot="afterProvincePrice" slot-scope="text, record">
@@ -115,11 +115,13 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
-import getDate from '@/libs/getDate.js'
+// 组件
 import { STable, VSelect } from '@/components'
+import getDate from '@/libs/getDate.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
+// 接口
 import { productPriceChangeList, productPriceChangeExport, priceChangeEnabled } from '@/api/product'
 export default {
   name: 'PriceChangeRecordList',
@@ -129,8 +131,11 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      //  查询条件
+      queryParam: {
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         name: '', //  产品名称
@@ -139,23 +144,25 @@ export default {
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        enabledFlag: undefined
+        enabledFlag: undefined// 变更状态
       },
-      productType: [],
-      disabled: false, //  查询、重置按钮是否可操作
+      productType: [], // 产品分类
+      //  变更时间
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ], //  变更时间
-      exportLoading: false, // 导出loading
+      ],
+      total: 0, // 数据总条数
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取表格数据 有分页
         return productPriceChangeList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -167,8 +174,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      total: 0
+      }
     }
   },
   computed: {
@@ -234,7 +240,7 @@ export default {
     }
   },
   methods: {
-    //  创建时间  change
+    //  变更时间 change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -304,6 +310,7 @@ export default {
         }
       })
     },
+    // 导出配置
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))
@@ -316,12 +323,14 @@ export default {
       document.body.appendChild(link)
       link.click()
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 225
@@ -346,6 +355,7 @@ export default {
     }
   },
   watch: {
+    // 展开/关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 37 - 27
src/views/productManagement/productLaunchAudit/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="productLaunchAuditList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="5" :sm="24">
               <a-form-item label="产品名称">
@@ -17,7 +17,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="提交时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="productLaunchAuditList-rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="4" :sm="24" v-if="queryParam.bizState == 'PASS'">
@@ -36,6 +36,7 @@
     <!-- 状态 -->
     <div style="background-color: #fff;">
       <v-select
+        id="productLaunchAuditList-bizState"
         v-model="queryParam.bizState"
         ref="state"
         showType="tabs"
@@ -47,7 +48,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 列表 -->
         <div v-if="$hasPermissions('B_productLaunchAudit_batchAudit')&&queryParam.bizState == 'WAIT'">
-          <a-button type="primary" ghost id="productLaunchAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
+          <a-button type="primary" ghost id="productLaunchAudit-batchAudit" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
           <span style="margin-left: 10px">
             <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
           </span>
@@ -99,9 +100,11 @@
 </template>
 
 <script>
-import rangeDate from '@/views/common/rangeDate.vue'
 import { commonMixin } from '@/utils/mixin'
+// 组件
+import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
+// 接口
 import { productLogList, productLogAuditBatch, productLogAudit, updateShowFlag } from '@/api/product'
 export default {
   name: 'ProductLaunchAuditList',
@@ -110,27 +113,30 @@ export default {
   data () {
     return {
       spinning: false,
-      time: [],
-      queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+      time: [], // 提交时间
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 表格加载状态
+      //  查询条件
+      queryParam: {
+        beginDate: '', // 提交开始时间
+        endDate: '', // 提交结束时间
         name: '', //  名称
         code: '', //  编码
         bizType: 'ONLINE', // 上线
         bizState: 'WAIT', //  状态
         newProductFlag: undefined// 是否新品
       },
-      tableHeight: 0,
-      disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取表格数据
         return productLogList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -139,11 +145,11 @@ export default {
             this.disabled = false
           }
           this.spinning = false
-          this.setTableH()
+          this.setTableH()// 计算表格高度
           return data
         })
       },
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 选中列表数据
     }
   },
   computed: {
@@ -169,7 +175,7 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    //  提交时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -190,19 +196,6 @@ export default {
       this.$refs.table.refresh(true)
     },
     // 单个审核
-    singAudit (row, state) {
-      const _this = this
-      _this.spinning = true
-      productLogAudit({ productLogSn: row.productLogSn, 'bizState': state }).then(res => {
-        if (res.status == 200) {
-          _this.$message.success(res.message)
-          _this.$refs.table.refresh()
-          _this.spinning = false
-        } else {
-          _this.spinning = false
-        }
-      })
-    },
     handleAudit (row) {
       const _this = this
       const modal = this.$confirm({
@@ -223,6 +216,20 @@ export default {
         }
       })
     },
+    // 单个审核 审核通过  审核不通过
+    singAudit (row, state) {
+      const _this = this
+      _this.spinning = true
+      productLogAudit({ productLogSn: row.productLogSn, 'bizState': state }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
     // 批量审核
     batchAudit (state) {
       const _this = this
@@ -244,6 +251,7 @@ export default {
         }
       })
     },
+    // 批量审核 先判断是否有勾选数据再审核
     handleBatchAudit () {
       const _this = this
       if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
@@ -283,6 +291,7 @@ export default {
         this.spinning = false
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -291,6 +300,7 @@ export default {
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - (this.queryParam.bizState == 'WAIT' ? 280 : 250)

+ 36 - 26
src/views/productManagement/productNotOnline/list.vue

@@ -1,50 +1,50 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="productPricingList-wrap searchBoxNormal">
+    <a-card size="small" :bordered="false" class="productNotOnline-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchForm">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品名称">
-                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+                <a-input id="productNotOnline-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品编码/原厂编码">
-                <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
+                <a-input id="productNotOnline-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="品牌">
-                <ProductBrand id="productPricingList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                <ProductBrand id="productNotOnline-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品分类">
-                  <ProductType id="productPricingList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
-                </a-form-model-item>
+                <a-form-item label="产品分类">
+                  <ProductType id="productNotOnline-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="定价时间">
-                  <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                  <rangeDate ref="rangeDate" id="productNotOnline-rangeDate" :value="time" @change="dateChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="定价状态">
-                  <v-select code="PRICING_STATUS" id="productPricingList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
+                  <v-select code="PRICING_STATUS" id="productNotOnline-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品状态">
-                  <v-select code="PRODUCT_STATUS" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
+                  <v-select code="PRODUCT_STATUS" id="productNotOnline-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="searchForm" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
+              <a-button type="primary" @click="searchForm" :disabled="disabled" id="productNotOnline-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productNotOnline-reset">重置</a-button>
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -52,8 +52,8 @@
                 @click="handleExport"
                 :disabled="disabled"
                 v-if="$hasPermissions('M_productOnlineExport')"
-                id="productInfoList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+                id="productNotOnline-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="productNotOnline-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -66,7 +66,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator" style="text-align:right;">
-          <a-checkbox v-model="zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag" @change="handleChangeQty">仅显示有库存</a-checkbox>
+          <a-checkbox v-model="zeroQtyFlag" id="productNotOnline-zeroQtyFlag" @change="handleChangeQty">仅显示有库存</a-checkbox>
         </div>
         <!-- 列表 -->
         <s-table
@@ -94,12 +94,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { exportExcel } from '@/libs/JGPrint.js'
+// 组件
 import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
-import { exportExcel } from '@/libs/JGPrint.js'
-import { queryOnlinePage, excelOnlineList } from '@/api/product'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
+// 接口
+import { queryOnlinePage, excelOnlineList } from '@/api/product'
 export default {
   name: 'ProductNotOnlineList',
   mixins: [commonMixin],
@@ -108,9 +110,11 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      time: [],
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      time: [], // 定价时间
+      //  查询条件
+      queryParam: {
         name: '', //  产品名称
         queryWord: '', // 产品编码/原厂编码
         productBrandSn: undefined, //  产品品牌
@@ -118,22 +122,23 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         pricingState: undefined, //  定价状态
-        pricingTimeBegin: undefined, // 定价时间
-        pricingTimeEnd: undefined,
+        pricingTimeBegin: undefined, // 定价开始时间
+        pricingTimeEnd: undefined, // 定价结束时间
         state: undefined, // 产品状态
-        stockFlag: undefined
+        stockFlag: undefined// 仅显示有库存 1是 0否
       },
-      zeroQtyFlag: false,
-      productType: [],
-      disabled: false, //  查询、重置按钮是否可操作
+      zeroQtyFlag: false, // 仅显示有库存 true是 false否
+      productType: [], // 产品分类
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取表格数据 有分页
         return queryOnlinePage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -192,6 +197,7 @@ export default {
       this.queryParam.pricingTimeBegin = date[0]
       this.queryParam.pricingTimeEnd = date[1]
     },
+    // 仅显示有库存
     handleChangeQty (e) {
       this.zeroQtyFlag = e.target.checked
       this.queryParam.stockFlag = e.target.checked ? '1' : undefined
@@ -218,6 +224,7 @@ export default {
       this.$refs.table.clearSelected() // 清空表格选中项
       this.$refs.table.refresh(true)
     },
+    // 查询
     searchForm () {
       this.$refs.table.clearSelected() // 清空表格选中项
       this.$refs.table.refresh(true)
@@ -239,18 +246,21 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 226
     }
   },
   watch: {
+    // 展开/关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 28 - 20
src/views/productManagement/productOfflineAudit/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="productOfflineAuditList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品名称">
@@ -39,14 +39,14 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="提交时间">
-                  <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                  <rangeDate ref="rangeDate" id="productOfflineAuditList-rangeDate" :value="time" @change="dateChange" />
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productOfflineAuditList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productOfflineAuditList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="productOfflineAuditList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -58,6 +58,7 @@
     <!-- 状态 -->
     <div style="background-color: #fff;">
       <v-select
+        id="productOfflineAuditList-bizState"
         v-model="queryParam.bizState"
         ref="state"
         showType="tabs"
@@ -69,7 +70,7 @@
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
         <div style="margin-bottom: 10px" v-if="$hasPermissions('B_productOfflineAudit_batchAudit')&&queryParam.bizState == 'WAIT'" >
-          <a-button type="primary" ghost id="productOfflineAudit-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
+          <a-button type="primary" ghost id="productOfflineAuditList-export" :loading="loading" @click="handleBatchAudit">批量审核</a-button>
           <span style="margin-left: 10px">
             <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
           </span>
@@ -113,11 +114,13 @@
 </template>
 
 <script>
-import rangeDate from '@/views/common/rangeDate.vue'
 import { commonMixin } from '@/utils/mixin'
+// 组件
+import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
+// 组件
 import { productLogList, productLogAudit, productLogAuditBatch } from '@/api/product'
 export default {
   name: 'ProductOfflineAuditList',
@@ -127,13 +130,16 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      time: [],
-      queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 表格加载状态
+      time: [], // 提交时间
+      //  查询参数
+      queryParam: {
+        beginDate: '', // 提交开始时间
+        endDate: '', // 提交结束时间
         name: '', //  产品名称
-        queryWord: '',
+        queryWord: '', // 产品编码/通用编码
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
@@ -142,13 +148,12 @@ export default {
         bizType: 'OFFLINE', // 下线
         bizState: 'WAIT' //  状态
       },
-      productType: [],
-      disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
+      productType: [], // 产品分类
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return productLogList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -156,13 +161,12 @@ export default {
             this.disabled = false
           }
           this.spinning = false
+          // 计算表格高度
           this.setTableH()
           return data
         })
       },
-      productBrandList: [], //  品牌下拉数据
-      productTypeList: [], //  分类下拉数据
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 表格选中数据
     }
   },
   computed: {
@@ -188,7 +192,7 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    //   提交时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -213,7 +217,7 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
-    // 单个审核
+    // 单个审核接口
     singAudit (row, state) {
       const _this = this
       _this.spinning = true
@@ -227,6 +231,7 @@ export default {
         }
       })
     },
+    // 单个审核弹窗提示
     handleAudit (row) {
       const _this = this
       const modal = this.$confirm({
@@ -268,7 +273,7 @@ export default {
         }
       })
     },
-    // 批量审核
+    // 批量审核弹窗提示
     handleBatchAudit () {
       const _this = this
       if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
@@ -299,6 +304,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -307,12 +313,14 @@ export default {
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - (this.queryParam.bizState == 'WAIT' ? 283 : 250)
     }
   },
   watch: {
+    // 展开/关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 15 - 10
src/views/productManagement/productUniversal/editModal.vue

@@ -19,13 +19,13 @@
           :wrapper-col="formItemLayout.wrapperCol"
         >
           <a-form-model-item label="产品编码" prop="productSn">
-            <productCodeList ref="productCodeList" @change="productCodeChange" />
+            <productCodeList id="productUniversalEdit-productSn" ref="productCodeList" @change="productCodeChange" />
           </a-form-model-item>
           <a-form-model-item label="产品名称">
             {{ productName || '--' }}
           </a-form-model-item>
           <a-form-model-item label="通用产品编码" prop="productCommonSn">
-            <productCodeList ref="productUniversalCodeList" @change="productUniversalCodeChange" />
+            <productCodeList id="productUniversalEdit-productCommonSn" ref="productUniversalCodeList" @change="productUniversalCodeChange" />
           </a-form-model-item>
           <a-form-model-item label="通用产品名称">
             {{ productCommonName || '--' }}
@@ -41,8 +41,10 @@
 </template>
 
 <script>
+// 组件
 import { VSelect } from '@/components'
 import productCodeList from '@/views/common/productCodeList.vue'
+// 接口
 import { productUniversalCodeSave, productUniversalCodeDetail } from '@/api/productUniversalCode'
 export default {
   name: 'ProductLevelEditModal',
@@ -52,30 +54,33 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemId: {// 通用产品id
       type: [Number, String],
       default: ''
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.itemId ? '编辑' : '新增') + '通用产品'
     }
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // 表单布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
       form: {
-        productCode: undefined,
-        productSn: undefined,
-        productCommonCode: undefined,
-        productCommonSn: undefined
+        productCode: undefined, // 产品列表
+        productSn: undefined, // 产品sn
+        productCommonCode: undefined, // 通用产品编码
+        productCommonSn: undefined// 通用产品sn
       },
+      // 表单验证规则
       rules: {
         productSn: [
           { required: true, message: '请选择产品编码', trigger: 'change' }
@@ -84,8 +89,8 @@ export default {
           { required: true, message: '请选择通用产品编码', trigger: 'change' }
         ]
       },
-      productName: '',
-      productCommonName: ''
+      productName: '', // 产品名称
+      productCommonName: ''// 通用产品名称
     }
   },
   methods: {

+ 22 - 14
src/views/productManagement/productUniversal/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="productUniversalList-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" if="productUniversalList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品编码">
@@ -106,9 +106,11 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+import { exportExcel } from '@/libs/JGPrint.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import productUniversalEditModal from './editModal.vue'
-import { exportExcel } from '@/libs/JGPrint.js'
+// 接口
 import { productUniversalCodeList, productUniversalCodeDel, productUniversalExport } from '@/api/productUniversalCode'
 export default {
   name: 'ProductUniversalList',
@@ -118,17 +120,19 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        productCode: '',
-        productName: '',
-        productState: undefined,
-        productCommonName: '',
-        productCommonCode: ''
-      },
-      productType: [],
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
+      queryParam: { //  查询条件
+        productCode: '', // 产品名称
+        productName: '', // 产品名称
+        productState: undefined, // 产品状态
+        productCommonName: '', // 通用产品名称
+        productCommonCode: ''// 通用产品编码
+      },
+      productType: [], // 产品分类
+      openModal: false, //  编辑  弹框
+      itemId: '', //  当前id
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -145,10 +149,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取表格数据 有分页
         return productUniversalCodeList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -158,9 +164,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      openModal: false, //  编辑  弹框
-      itemId: '' //  当前id
+      }
     }
   },
   methods: {
@@ -217,6 +221,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 配置导出参数
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))
@@ -229,18 +234,21 @@ export default {
       document.body.appendChild(link)
       link.click()
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240
     }
   },
   watch: {
+    // 展开/关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调