chenrui преди 11 месеца
родител
ревизия
cf482f99bd

+ 30 - 24
src/views/dataExport/exportCheck/list.vue

@@ -29,7 +29,7 @@
           <a-row :gutter="15">
             <a-col :md="12" :sm="24">
               <a-form-model-item label="选择盘点单" prop="checkWarehouseSn">
-                <a-select id="exportCheckList-print" v-model="queryParam.checkWarehouseSn" placeholder="请选择盘点单" allowClear>
+                <a-select id="exportCheckList-checkWarehouseSn" v-model="queryParam.checkWarehouseSn" placeholder="请选择盘点单" allowClear>
                   <a-select-option v-for="item in checkList" :value="item.checkWarehouseSn" :key="item.checkWarehouseSn">
                     <span>{{ item.financeAuditTime }} - {{ item.checkWarehouseNo }}</span>
                   </a-select-option>
@@ -39,13 +39,13 @@
           </a-row>
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }">
             <a-button
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                id="exportCheckList-export">导出</a-button>
-            <a-button @click="pageInit" style="margin-left: 15px" id="chooseCustom-btn-back">重置</a-button>
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              id="exportCheckList-export">导出</a-button>
+            <a-button @click="pageInit" style="margin-left: 15px" id="exportCheckList-reset">重置</a-button>
           </a-form-model-item>
         </a-form-model>
       </div>
@@ -55,10 +55,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
-import { checkWarehouseExcelList, checkWarehouseExport } from '@/api/checkWarehouse'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
+import { checkWarehouseExcelList, checkWarehouseExport } from '@/api/checkWarehouse'
 export default {
   name: 'ExportCheckList',
   mixins: [commonMixin],
@@ -66,28 +68,30 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
-      queryParam: { //  查询条件
-        checkWarehouseSn: undefined,
-        warehouseSn: undefined
+      labelCol: { span: 8 }, // label 标签布局
+      wrapperCol: { span: 16 }, // 表单设置布局
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        checkWarehouseSn: undefined, // 盘点单 sn
+        warehouseSn: undefined// 仓库sn
       },
+      // 表单验证规则
       rules: {
         checkWarehouseSn: [{ required: true, message: '请选择盘点单', trigger: 'change' }],
         warehouseSn: [{ required: true, message: '请选择仓库', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      checkList: []
+      checkList: []// 盘点单数据
     }
   },
   methods: {
+    // 获取盘点单数据
     getList (v) {
       this.queryParam.checkWarehouseSn = undefined
       this.checkList = []
-      if(v){
-        checkWarehouseExcelList({warehouseSn: this.queryParam.warehouseSn}).then(res => {
+      if (v) {
+        checkWarehouseExcelList({ warehouseSn: this.queryParam.warehouseSn }).then(res => {
           if (res.status == 200) {
             this.checkList = res.data || []
           } else {
@@ -114,15 +118,17 @@ export default {
         }
       })
     },
-    loadWareHouse(){
+    // 加载仓库信息
+    loadWareHouse () {
       const defWareHouse = this.$store.state.app.defWarehouse
       this.queryParam.checkWarehouseSn = undefined
-      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
+      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse ? defWareHouse.warehouseSn : undefined)
 
-      if(!this.isShowWarehouse){
+      if (!this.isShowWarehouse) {
         this.getList(true)
       }
     },
+    // 初始化数据
     pageInit () {
       this.$refs.ruleForm.resetFields()
     }

+ 34 - 29
src/views/dataExport/exportSales/list.vue

@@ -1,10 +1,10 @@
 <template>
-  <a-card size="small" :bordered="false" class="exportCheckList-wrap">
+  <a-card size="small" :bordered="false" class="exportSalesList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
       <div ref="tableSearch">
         <a-form-model
-          id="exportCheckList-form"
+          id="exportSalesList-form"
           ref="ruleForm"
           class="form-model-con"
           :model="queryParam"
@@ -19,7 +19,7 @@
                   v-model="queryParam.warehouseSn"
                   isPermission
                   @load="loadWareHouse"
-                  id="exportCheckList-warehouseSn"
+                  id="exportSalesList-warehouseSn"
                   placeholder="请选择仓库"
                   @change="getList"
                 />
@@ -29,7 +29,7 @@
           <a-row :gutter="15">
             <a-col :md="12" :sm="24">
               <a-form-model-item label="选择时间范围" prop="dateArr">
-                <a-select id="exportCheckList-print" v-model="queryParam.dateArr" placeholder="请选择时间范围" allowClear>
+                <a-select id="exportSalesList-dateArr" v-model="queryParam.dateArr" placeholder="请选择时间范围" allowClear>
                   <a-select-option v-for="item in checkList" :value="item" :key="item">
                     <span>{{ item }}</span>
                   </a-select-option>
@@ -39,13 +39,13 @@
           </a-row>
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }">
             <a-button
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                id="exportCheckList-export">导出</a-button>
-            <a-button @click="pageInit" style="margin-left: 15px" id="chooseCustom-btn-back">重置</a-button>
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              id="exportSalesList-export">导出</a-button>
+            <a-button @click="pageInit" style="margin-left: 15px" id="exportSalesList-reset">重置</a-button>
           </a-form-model-item>
         </a-form-model>
       </div>
@@ -55,11 +55,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
+import warehouse from '@/views/common/chooseWarehouse.js'
+// 接口
 import { checkWarehouseExcelList } from '@/api/checkWarehouse'
 import { exportSalesOutProduct } from '@/api/stockOut.js'
-import warehouse from '@/views/common/chooseWarehouse.js'
-import { hdExportExcel } from '@/libs/exportExcel'
 export default {
   name: 'ExportSalesList',
   mixins: [commonMixin],
@@ -67,28 +69,29 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
-      queryParam: { //  查询条件
-        dateArr: undefined,
-        warehouseSn: undefined
+      labelCol: { span: 8 }, // form表单label横向距离
+      wrapperCol: { span: 16 }, // form表单行缩进距离
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        dateArr: undefined, // 时间范围
+        warehouseSn: undefined// 仓库
       },
       rules: {
-        'dateArr': [{ required: true, message: '请选择时间范围', trigger: 'change' }],
+        dateArr: [{ required: true, message: '请选择时间范围', trigger: 'change' }],
         warehouseSn: [{ required: true, message: '请选择仓库', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      checkList: []
+      checkList: []// 时间范围数据
     }
   },
   methods: {
+    // 获取时间范围数据
     getList (v) {
       this.queryParam.dateArr = undefined
       this.checkList = []
-      if(v){
-        checkWarehouseExcelList({warehouseSn: this.queryParam.warehouseSn}).then(res => {
+      if (v) {
+        checkWarehouseExcelList({ warehouseSn: this.queryParam.warehouseSn }).then(res => {
           if (res.status == 200) {
             const arr = res.data.reverse()
             for (let i = arr.length - 1; i > 0; i--) {
@@ -118,15 +121,17 @@ export default {
         }
       })
     },
-    loadWareHouse(){
+    // 选择仓库 change
+    loadWareHouse () {
       const defWareHouse = this.$store.state.app.defWarehouse
       this.queryParam.dateArr = undefined
-      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
+      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse ? defWareHouse.warehouseSn : undefined)
 
-      if(!this.isShowWarehouse){
+      if (!this.isShowWarehouse) {
         this.getList(true)
       }
     },
+    // 初始化数据
     pageInit () {
       this.$refs.ruleForm.resetFields()
     }
@@ -152,7 +157,7 @@ export default {
 }
 </script>
 <style lang="less">
-  .exportCheckList-wrap{
+  .exportSalesList-wrap{
     height: 99%;
     .form-model-con{
       margin-top: 50px;

+ 10 - 6
src/views/productManagement/productInfo/chooseImportModal.vue

@@ -68,16 +68,17 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { batchImportProduct, exportErrorProduct } from '@/api/product'
 export default {
-  name: 'SalesChooseImportModal',
+  name: 'ProductChooseImportModal',
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: {// 导入数据
       type: Object,
       default: () => {
         return {}
@@ -109,7 +110,7 @@ export default {
         { title: '产品说明', dataIndex: 'description', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '其他说明', dataIndex: 'otherDesc', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
-      loadData: [],
+      loadData: [], // 可导入数据
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
         { title: '产品名称', dataIndex: 'name', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -133,11 +134,12 @@ export default {
         { title: '其他说明', dataIndex: 'otherDesc', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '备注', dataIndex: 'errorMsg', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      unLoadData: [],
-      loading: false
+      unLoadData: [], // 导入错误数据
+      loading: false// 列表加载状态
     }
   },
   methods: {
+    // 获取导入列表数据
     getData () {
       const _this = this
       this.loading = true
@@ -147,11 +149,13 @@ export default {
       batchImportProduct(params).then(res => {
         this.loading = false
         if (res.status == 200) {
+          // 计算可导入列表序号
           if (res.data.rightList && res.data.rightList.length > 0) {
             res.data.rightList.map((item, index) => {
               item.no = index + 1
             })
           }
+          // 计算错误项列表序号
           if (res.data.errorList && res.data.errorList.length > 0) {
             res.data.errorList.map((item, index) => {
               item.no = index + 1
@@ -171,7 +175,7 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.unLoadData.length < 1) {

+ 23 - 13
src/views/productManagement/productInfo/edit.vue

@@ -4,7 +4,7 @@
       <a-page-header :ghost="false" :backIcon="false" class="productInfoEdit-cont" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a id="productInfoEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
       </a-page-header>
       <a-form-model
@@ -104,7 +104,7 @@
                 <span style="margin: 0 5px;">/</span>
                 <v-select
                   code="PRODUCT_PACK_UNIT"
-                  id="productLevelEdit-packQtyUnit"
+                  id="productInfoEdit-packQtyUnit"
                   v-model="form.packQtyUnit"
                   allowClear
                   style="width: 100px;"
@@ -173,7 +173,7 @@
               <a-form-model-item label="颜色" prop="color">
                 <a-input
                   v-model.trim="form.color"
-                  id="productLevelEdit-color"
+                  id="productInfoEdit-color"
                   :maxLength="50"
                   allowClear
                   placeholder="请输入颜色(最多50个字符)" />
@@ -196,7 +196,7 @@
             </a-col>
             <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
               <a-form-model-item label="其他说明" prop="otherDesc" :label-col="{span:2}" :wrapper-col="{span:20}">
-                <editor id="productInfoEdit-other-otherDesc" ref="otherDesc" class="productInfoEdit-otherDesc" @on-change="editorOtherChange" :cache="false"></editor>
+                <editor id="productInfoEdit-otherDesc" ref="otherDesc" class="productInfoEdit-otherDesc" @on-change="editorOtherChange" :cache="false"></editor>
               </a-form-model-item>
             </a-col>
           </a-row>
@@ -218,12 +218,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
+// 接口
 import { productSave, productSnDetail } from '@/api/product'
 import { productTypeQueryAll } from '@/api/productType'
 import { productBrandQuery } from '@/api/productBrand'
-import { validateSpecialCharacter } from '@/libs/tools'
 export default {
   name: 'ProductInfoEdit',
   mixins: [commonMixin],
@@ -232,8 +233,8 @@ export default {
     return {
       spinning: false,
       formItemLayout: {
-        labelCol: { span: 4 },
-        wrapperCol: { span: 16 }
+        labelCol: { span: 4 }, // label 标签布局
+        wrapperCol: { span: 16 }// 输入控件布局
       },
       form: {
         name: '', // 产品名称
@@ -249,7 +250,7 @@ export default {
         packQty: '', // 包装数
         packQtyUnit: undefined, // 包装数单位
         arrowFalg: undefined, // 是否箭冠产品
-        qrCode: '',
+        qrCode: '', // 条形码
         productMsg: '', //  产品图片
         size: '', // 产品尺寸
         weight: '', // 产品重量
@@ -258,13 +259,14 @@ export default {
         description: '', // 产品说明
         otherDesc: '' // 其他说明
       },
+      // 表单验证规则
       rules: {
         name: [
-          { required: true, message: '请输入产品名称', trigger: 'change' },
+          { required: true, message: '请输入产品名称', trigger: 'change' }
           // { validator: validateSpecialCharacter, trigger: 'change' }
         ],
         code: [
-          { required: true, message: '请输入产品编码', trigger: 'change' },
+          { required: true, message: '请输入产品编码', trigger: 'change' }
           // { validator: validateSpecialCharacter, trigger: 'change' }
         ],
         origCode: [
@@ -295,13 +297,15 @@ export default {
     }
   },
   methods: {
-    //  详情
+    //  获取编辑回显数据
     getDetail () {
       productSnDetail({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           const data = res.data
           this.form = Object.assign(this.form, data)
+          // 产品分类回显赋值
           this.form.productType = [ this.form.productTypeSn1, this.form.productTypeSn2, this.form.productTypeSn3 ]
+          // 产品图片回显
           if (res.data.productPicList && res.data.productPicList.length > 0) {
             let str = ''
             res.data.productPicList.map(item => {
@@ -316,6 +320,7 @@ export default {
             this.$refs.productMsg.setFileList('')
             this.form.productMsg = ''
           }
+          // 产品说明回显
           this.$refs.editor.setHtml(res.data.description)
           this.$refs.otherDesc.setHtml(res.data.otherDesc)
         } else {
@@ -325,16 +330,19 @@ export default {
     },
     // 提交
     handleSubmit (e) {
+      // 防止表单重复提交
       e.preventDefault()
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          // 判断产品分类是否选择到第三级
           if (!form.productTypeSn3) {
             this.$message.warning('产品分类未选到第三级,请修改后再提交!')
             return false
           }
           form.id = _this.$route.params.id ? _this.$route.params.id : undefined
+          // 产品图片
           form.productPicList = []
           if (form.productMsg) {
             const arr = form.productMsg.split(',')
@@ -365,13 +373,13 @@ export default {
     },
     // 返回
     handleBack () {
-      this.$router.push({ path: '/productManagement/productInfo/list', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'productInfoList', query: { closeLastOldTab: true } })
     },
     // 产品图片上传
     changeImage (file) {
-      console.log(file.split(","))
       this.form.productMsg = file
     },
+    // 验证 条形码 规则
     validateQrCode (rule, value, callback) {
       const reg = /^[0-9a-zA-Z]+$/
       if (value && !reg.test(value)) {
@@ -438,11 +446,13 @@ export default {
         })
       }
     },
+    // 根据输入项进行筛选
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    // 初始化数据
     pageInit () {
       this.$refs.productMsg.setFileList('')
       this.$refs.editor.setHtml('')

+ 10 - 12
src/views/productManagement/productInfo/importGuideModal.vue

@@ -24,6 +24,7 @@
           </ul>
           <a-button
             v-if="guideType=='1'"
+            id="importGuide-export"
             type="link"
             icon="download"
             style="padding: 0 0 0 23px;"
@@ -74,6 +75,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import ChooseImportModal from './chooseImportModal.vue'
 import offlineImportModal from './offlineImportModal.vue'
 import { Upload } from '@/components'
@@ -86,11 +88,7 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
-      type: Object,
-      default: null
-    },
-    guideType: {
+    guideType: {// 产品导入类型  1 新增产品导入 2下线产品导入
       type: String,
       default: ''
     }
@@ -98,15 +96,15 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
-      uploadParams: {
+      openImportModal: false, //  打开新增产品导入弹框
+      openOfflineImportModal: false, // 打开下线产品导入弹框
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传地址
+      paramsData: null, // 导入参数
+      uploadParams: {// 上传参数
         savePathType: 'local'
       },
-      exportLoading: false,
-      openOfflineImportModal: false,
-      filePath: location.protocol + '//' + location.host + '/templ/批量下线导入模板.xlsx'
+      exportLoading: false, // 导出按钮加载状态
+      filePath: location.protocol + '//' + location.host + '/templ/批量下线导入模板.xlsx'// 模板地址
     }
   },
   methods: {

+ 39 - 30
src/views/productManagement/productInfo/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="productInfoList-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="productInfoList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品名称">
@@ -49,13 +49,13 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="最近修改时间">
-                  <rangeDate ref="rangeDate" @change="dateChange" />
-                </a-form-model-item>
+                <a-form-item label="最近修改时间">
+                  <rangeDate id="productInfoList-rangeDate" ref="rangeDate" @change="dateChange" />
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="停产状态">
-                  <a-select v-model="queryParam.haltProdFlag" placeholder="请选择停产状态" allowClear>
+                  <a-select v-model="queryParam.haltProdFlag" id="productInfoList-haltProdFlag" placeholder="请选择停产状态" allowClear>
                     <a-select-option value="0">
                       启用
                     </a-select-option>
@@ -78,7 +78,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="productInfoList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" id="productInfoList-isAdvanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -91,10 +91,9 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator">
-          <a-button type="primary" v-if="$hasPermissions('B_productInfo_add')" @click="handleEdit()">新增</a-button>
-          <a-button type="primary" class="button-info" @click="handleMenuClick({key:'1'})" v-if="$hasPermissions('B_productInfo_batchImport')"> 新增产品导入</a-button>
-          <a-button type="primary" class="button-info" @click="handleMenuClick({key:'2'})" v-if="$hasPermissions('B_offlineProduct_import')"> 下线产品导入</a-button>
-          
+          <a-button type="primary" id="productInfoList-add" v-if="$hasPermissions('B_productInfo_add')" @click="handleEdit()">新增</a-button>
+          <a-button type="primary" id="productInfoList-addProduct" class="button-info" @click="handleMenuClick({key:'1'})" v-if="$hasPermissions('B_productInfo_batchImport')"> 新增产品导入</a-button>
+          <a-button type="primary" id="productInfoList-import" class="button-info" @click="handleMenuClick({key:'2'})" v-if="$hasPermissions('B_offlineProduct_import')"> 下线产品导入</a-button>
           <a-button
             id="productInfoList-batchAudit"
             type="primary"
@@ -120,9 +119,9 @@
             :loading="loadingDownline"
             @click="handleBatchDownline"
             style="margin: 0 5px;">批量下线</a-button>
-           <span style="margin-left: 8px" v-if="$hasPermissions('B_productInfo_batchAudit') || $hasPermissions('B_productInfo_batchLaunch') || $hasPermissions('B_productInfo_batchDownline')">
-              <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
-            </span>
+          <span style="margin-left: 8px" v-if="$hasPermissions('B_productInfo_batchAudit') || $hasPermissions('B_productInfo_batchLaunch') || $hasPermissions('B_productInfo_batchDownline')">
+            <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
+          </span>
         </div>
         <s-table
           class="sTable fixPagination"
@@ -146,6 +145,7 @@
               自有<a-icon type="question-circle" :style="{ marginLeft: '10px' }" />
             </a-tooltip>
           </template>
+          <!-- 判断是否是自有产品 -->
           <template slot="arrowFalg" slot-scope="text, record">
             <span v-if="record.arrowFalg">{{ record.arrowFalg == 1 ? '是' : '否' }}</span>
             <span v-else>--</span>
@@ -160,7 +160,7 @@
             <a-switch
               checkedChildren="启用"
               unCheckedChildren="停产"
-              id="roleList-isEnable"
+              id="productInfoList-isEnable"
               v-model="record.stopFlag"
               @change="changeFlagHandle(record)" />
           </template>
@@ -231,14 +231,16 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { exportExcel } from '@/libs/JGPrint.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import productInfoDetailModal from './detailModal.vue'
 import productInfoOfflineModal from './offlineModal.vue'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
-import { exportExcel } from '@/libs/JGPrint.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import importGuideModal from './importGuideModal.vue'
+// 接口
 import { productList, productAudit, productBatchAudit, productDel, productOnline, productBatchOnline, productExport, saveBatchImportProduct, importSaveBatch, updateHaltProdFlag } from '@/api/product'
 export default {
   name: 'ProductInfoList',
@@ -248,11 +250,14 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
         haltProdFlag: undefined, // 停产状态
-        updateBeginDate: '',
-        updateEndDate: '',
+        updateBeginDate: '', // 最近修改时间 开始日期
+        updateEndDate: '', // 最近修改时间 结束日期
         name: '', //  产品名称
         queryWord: '', // 产品编码/原厂编码
         productBrandSn: undefined, //  产品品牌
@@ -261,12 +266,11 @@ export default {
         productTypeSn3: '', //  产品三级分类
         state: undefined, //  产品状态
         pricingState: undefined, //  定价状态
-        picFlag: undefined
+        picFlag: undefined// 产品图片
       },
-      productType: [],
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      openGuideModal: false,
+      productType: [], // 产品类型
+
+      openGuideModal: false, // 导入产品 弹窗
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -284,17 +288,19 @@ export default {
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '5%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
-      loadingAudit: false,
-      loadingLaunch: false,
-      loadingDownline: false,
+      loadingAudit: false, // 审核按钮加载状态
+      loadingLaunch: false, // 上线按钮加载状态
+      loadingDownline: false, // 下线按钮加载状态
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return productList(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
@@ -310,8 +316,8 @@ export default {
       itemSn: '', //  当前sn
       openOfflineModal: false, //  下线  弹框
       offlineProductList: [], //  下线 当前所选数据
-      pageFromInfo: null,
-      rowSelectionInfo: null,
+      pageFromInfo: null, // 页面跳转来源  productInfoAdd
+      rowSelectionInfo: null, // 表格选中数据
       guideModalType: ''// 1 新增产品批量导入 2下线产品批量导入
     }
   },
@@ -327,7 +333,7 @@ export default {
       this.guideModalType = e.key
       this.openGuideModal = true
     },
-    //  创建时间  change
+    //  最近修改时间  change
     dateChange (date) {
       this.queryParam.updateBeginDate = date[0] || ''
       this.queryParam.updateEndDate = date[1] || ''
@@ -607,18 +613,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 - 240
     }
   },
   watch: {
+    // 监听 展开关闭时表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 42 - 31
src/views/productManagement/productInfo/offlineImportModal.vue

@@ -1,21 +1,21 @@
 <template>
   <a-modal
     centered
-    class="chooseImport-modal"
+    class="offlineImport-modal"
     :footer="null"
     :maskClosable="false"
     title="导入"
     v-model="isShow"
     @cancel="isShow=false"
     width="60%">
-    <div class="chooseImport-con">
+    <div class="offlineImport-con">
       <!-- 可导入数据 -->
       <p style="font-weight:bold;">可导入数据{{ loadData.length }}条,确认要批量下线吗?</p>
       <a-form-model :model="form" ref="ruleForm" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
         <a-form-model-item label="下线选项" prop="offlineReasonType">
           <v-select
             code="OFFLINE_REASON_TYPE"
-            id="productInfoOffline-offlineReasonType"
+            id="offlineImport-offlineReasonType"
             v-model="form.offlineReasonType"
             allowClear
             placeholder="请选择下线选项"
@@ -40,6 +40,7 @@
         </a-form-model-item>
         <a-form-model-item label="下线备注">
           <a-textarea
+            id="offlineImport-offlineRemark"
             v-model="form.offlineRemark"
             placeholder="请输入下线备注(最多60个字符)"
             :maxLength="60"
@@ -68,20 +69,20 @@
       <div class="btn-con">
         <a-button
           type="primary"
-          id="chooseImport-submit"
+          id="offlineImport-submit"
           size="large"
           :class="loadData.length==0?'button-grey':'button-primary'"
           @click="handleSubmit"
           style="padding: 0 40px;">确认导入</a-button>
         <a-button
-          id="chooseImport-cancel"
+          id="offlineImport-cancel"
           size="large"
           class="button-cancel"
           @click="isShow=false"
           style="padding: 0 40px;margin-left: 15px;">取消</a-button>
         <a-button
           type="primary"
-          id="chooseImport-error"
+          id="offlineImport-error"
           size="large"
           class="button-error"
           @click="handleError"
@@ -92,13 +93,15 @@
 </template>
 
 <script>
-import { VSelect } from '@/components'
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { offlineImport, exportErrorOffline } from '@/api/product'
+// 组件
+import { VSelect } from '@/components'
 import productCodeList from '@/views/common/productCodeList.vue'
+// 接口
+import { offlineImport, exportErrorOffline } from '@/api/product'
 export default {
-  name: 'SalesChooseImportModal',
+  name: 'SalesofflineImportModal',
   mixins: [commonMixin],
   components: { VSelect, productCodeList },
   props: {
@@ -106,7 +109,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: {// 导入数据
       type: Object,
       default: () => {
         return {}
@@ -118,26 +121,27 @@ export default {
       labelCol: { span: 2 },
       wrapperCol: { span: 22 },
       isShow: this.openModal, //  是否打开弹框
+      form: {
+        type: 'offline', // 下线状态
+        offlineReasonType: undefined, // 通用编码类型
+        offlineRemark: '', // 下线备注
+        offlineProductList: []// 下线产品列表
+      },
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
         { title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '通用编码', scopedSlots: { customRender: 'currency' }, width: '5%', align: 'center' }
       ],
-      loadData: [],
-      form: {
-        type: 'offline',
-        offlineReasonType: undefined,
-        offlineRemark: '',
-        offlineProductList: []
-      },
+      loadData: [], // 可导入数据
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
         { title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '通用编码', dataIndex: 'commonCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remark', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      unLoadData: [],
-      loading: false,
+      unLoadData: [], // 导入错误数据
+      loading: false, // 列表加载状态
+      // 选择下线产品 规则验证
       rules: {
         offlineReasonType: [
           { required: true, message: '请选择下线选项', trigger: 'change' }
@@ -146,12 +150,14 @@ export default {
     }
   },
   methods: {
+    // 产品编码 change
     productCodeChange (val, row) {
       row.commonSn = val.key
       if (val && val.row) {
         row.commonCode = val.row.code
       }
     },
+    // 获取导入数据
     getData () {
       const _this = this
       this.loading = true
@@ -196,6 +202,7 @@ export default {
         })
       }
     },
+    // 验证是否是通用编码
     isHandleOk () {
       const _this = this
       if (_this.form.offlineReasonType === '通用') {
@@ -209,7 +216,7 @@ export default {
       _this.$emit('ok', JSON.parse(JSON.stringify(_this.form)))
       _this.isShow = false
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.unLoadData.length < 1) {
@@ -220,6 +227,18 @@ export default {
       hdExportExcel(exportErrorOffline, _this.unLoadData, '导出产品错误项', function () {
         _this.spinning = false
       })
+    },
+    // 重置表单选择
+    resetSearchForm () {
+      this.loadData = []
+      this.unLoadData = []
+      this.form = {
+        type: 'offline',
+        offlineReasonType: undefined,
+        offlineRemark: '',
+        offlineProductList: []
+      }
+      this.$refs.ruleForm.resetFields()
     }
   },
   watch: {
@@ -231,15 +250,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.loadData = []
-        this.unLoadData = []
-        this.form = {
-          type: 'offline',
-          offlineReasonType: undefined,
-          offlineRemark: '',
-          offlineProductList: []
-        }
-        this.$refs.ruleForm.resetFields()
+        this.resetSearchForm()
       } else {
         this.getData()
       }
@@ -249,8 +260,8 @@ export default {
 </script>
 
 <style lang="less" scoped>
-  .chooseImport-modal{
-    .chooseImport-con{
+  .offlineImport-modal{
+    .offlineImport-con{
       .red{
         color: #f30;
       }

+ 17 - 10
src/views/productManagement/productInfo/offlineModal.vue

@@ -12,7 +12,7 @@
     <p v-else style="font-weight: bold;margin-left: 20px;">已选有效数据{{ loadData.length }}条,确认要批量下线吗?</p>
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="productInfoEdit-form"
+        id="productInfoOffline-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
@@ -62,18 +62,20 @@
 </template>
 
 <script>
+// 组件
 import { VSelect } from '@/components'
 import productCodeList from '@/views/common/productCodeList.vue'
+// 接口
 import { productOffline } from '@/api/product'
 export default {
-  name: 'ProductInfoDetailModal',
+  name: 'ProductInfoOfflineModal',
   components: { VSelect, productCodeList },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    offlineProductList: {
+    offlineProductList: {// 下线产品列表
       type: Array,
       default: () => {
         return []
@@ -84,14 +86,15 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
-      formItemLayout: {
+      formItemLayout: {// form表单布局设置
         labelCol: { span: 3 },
         wrapperCol: { span: 21 }
       },
       form: {
-        offlineReasonType: undefined,
-        offlineRemark: ''
+        offlineReasonType: undefined, // 下线类型选择
+        offlineRemark: ''// 下线备注
       },
+      // 表单验证规则
       rules: {
         offlineReasonType: [
           { required: true, message: '请选择下线选项', trigger: 'change' }
@@ -101,10 +104,11 @@ export default {
         { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '通用编码', scopedSlots: { customRender: 'commonProductList' }, align: 'center' }
       ],
-      loadData: []
+      loadData: []// 产品下线数据
     }
   },
   methods: {
+    // 通用产品 change
     productCodeChange (val, row) {
       row.commonProductList = []
       if (val.length > 0) {
@@ -151,6 +155,11 @@ export default {
           return false
         }
       })
+    },
+    resetSearchForm () {
+      this.loadData = []
+      this.form.offlineReasonType = undefined
+      this.form.offlineRemark = ''
     }
   },
   watch: {
@@ -162,9 +171,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.loadData = []
-        this.form.offlineReasonType = undefined
-        this.form.offlineRemark = ''
+        this.resetSearchForm()
       }
     },
     offlineProductList: {

+ 7 - 6
src/views/productManagement/productPricing/auditModal.vue

@@ -60,8 +60,9 @@
 </template>
 
 <script>
-import { productPricingSnDetail, productPricingAudit } from '@/api/product'
 import { toThousands } from '@/libs/tools.js'
+// 接口
+import { productPricingSnDetail, productPricingAudit } from '@/api/product'
 export default {
   name: 'ProductPricingAuditModal',
   props: {
@@ -69,21 +70,21 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: {// 审核sn
       type: [Number, String],
       default: ''
     }
   },
   data () {
     return {
-      toThousands,
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      toThousands, // 金额 截取到两位函数 3位添加‘,’
+      isShow: this.openModal, //  是否打开弹框
       detailsData: null //  详情数据
     }
   },
   methods: {
-    //  获取详情
+    //  获取详情数据
     getDetail () {
       productPricingSnDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
@@ -93,7 +94,7 @@ export default {
         }
       })
     },
-    // 审核
+    // 审核  type =='AUDIT_REJECT'?'不通过':'通过(PRICED)'
     handleAudit (type) {
       const ajaxData = {
         id: this.detailsData.id,

+ 7 - 5
src/views/productManagement/productPricing/chooseImportModal.vue

@@ -68,6 +68,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { productPriceImport, productPriceFailExcel } from '@/api/product'
 export default {
   name: 'ChooseImportModal',
@@ -77,7 +78,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: {// 导入数据
       type: Object,
       default: () => {
         return {}
@@ -99,7 +100,7 @@ export default {
         { title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '变更原因', dataIndex: 'changeReason', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
+      loadData: [], // 可导入数据
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
         { title: '产品名称', dataIndex: 'name', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -112,11 +113,12 @@ export default {
         { title: '变更原因', dataIndex: 'changeReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorMsg', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      unLoadData: [],
-      loading: false
+      unLoadData: [], // 导入错误数据
+      loading: false// 列表加载状态
     }
   },
   methods: {
+    // 获取导入列表数据
     getData () {
       const _this = this
       this.loading = true
@@ -150,7 +152,7 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.unLoadData.length < 1) {

+ 5 - 4
src/views/productManagement/productPricing/editModal.vue

@@ -108,6 +108,7 @@
 
 <script>
 import { VSelect } from '@/components'
+// 接口
 import { productPricingSnDetail, productPricingSave } from '@/api/product'
 export default {
   name: 'ProductPricingEditModal',
@@ -117,16 +118,16 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: {// 定价产品sn
       type: [Number, String],
       default: ''
     }
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
-      formItemLayout: {
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {// 表单布局设置
         labelCol: { span: 4 },
         wrapperCol: { span: 17 }
       },
@@ -136,7 +137,7 @@ export default {
         afterSpecialPrice: '', // 特约价
         afterTerminalPrice: '', // 终端价
         afterCarOwnersPrice: '', // 车主价
-        changeReason: undefined
+        changeReason: undefined// 变更原因
       },
       rules: {
         changeReason: [

+ 16 - 8
src/views/productManagement/productPricing/importGuideModal.vue

@@ -19,7 +19,13 @@
             <li>2) “产品编码”必须是列表中已存在的产品</li>
             <li>3) 产品首次定价,省级价、市级价、特约价不可为空,再次定价导入时可为空,为空表示不对原有价格做改变</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
+          <a-button
+            id="importGuide-download"
+            type="link"
+            icon="download"
+            style="padding: 0 0 0 23px;"
+            :loading="exportLoading"
+            @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -63,9 +69,11 @@
 </template>
 
 <script>
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { productPriceTplDownload } from '@/api/product'
 export default {
   name: 'ImportGuideModal',
@@ -83,13 +91,13 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
-      uploadParams: {
+      exportLoading: false, // 导出按钮加载状态
+      openImportModal: false, //  打开导入详情弹窗
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传文件地址
+      paramsData: null, // 导入数据
+      uploadParams: {// 上传文件参数
         savePathType: 'local'
-      },
-      exportLoading: false
+      }
     }
   },
   methods: {

+ 27 - 16
src/views/productManagement/productPricing/list.vue

@@ -22,13 +22,13 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品分类">
+                <a-form-item label="产品分类">
                   <ProductType id="productPricingList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="定价时间">
-                  <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                  <rangeDate id="productPricingList-rangeDate" ref="rangeDate" :value="time" @change="dateChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -47,7 +47,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 v-if="$hasPermissions('B_ProductPriceExoprt')"
-                id="productInfoList-export">导出</a-button>
+                id="productPricingList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -168,15 +168,17 @@
 
 <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 productPricingEditModal from './editModal.vue'
 import productPricingAuditModal from './auditModal.vue'
-import { productPricingList, productExportPricing, batchAuditPrice, productPriceInsertImport } from '@/api/product'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import ImportGuideModal from './importGuideModal.vue'
+// 接口
+import { productPricingList, productExportPricing, batchAuditPrice, productPriceInsertImport } from '@/api/product'
 export default {
   name: 'ProductPricingList',
   mixins: [commonMixin],
@@ -185,10 +187,12 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      openGuideModal: false,
-      tableHeight: 0,
-      time: [],
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      openGuideModal: false, // 打开定价导入弹窗
+      tableHeight: 0, // 表格高度
+      time: [], // 定价时间
+      //  查询条件
+      queryParam: {
         name: '', //  产品名称
         queryWord: '', // 产品编码/原厂编码
         productBrandSn: undefined, //  产品品牌
@@ -196,19 +200,20 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         pricingState: undefined, //  定价状态
-        beginDate: undefined,
-        endDate: undefined
+        beginDate: undefined, // 定价开始时间
+        endDate: undefined// 定价结束时间
       },
-      productType: [],
-      disabled: false, //  查询、重置按钮是否可操作
+      productType: [], // 产品分类
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return productPricingList(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
@@ -223,12 +228,13 @@ export default {
       total: 0, // 合计
       openModal: false, //  编辑  弹框
       openAuditModal: false, //  审核  弹框
-      openPriceAuditModal: false,
+      openPriceAuditModal: false, // 价格审核 弹框
       itemSn: '', //  当前产品sn
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 选中的表格数据
     }
   },
   computed: {
+    // 计算选中列表条数
     selTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys ? this.rowSelectionInfo.selectedRowKeys.length : 0
     },
@@ -284,6 +290,7 @@ export default {
       this.$refs.table.clearSelected() // 清空表格选中项
       this.$refs.table.refresh(true)
     },
+    // 查询
     searchForm () {
       this.$refs.table.clearSelected() // 清空表格选中项
       this.$refs.table.refresh(true)
@@ -293,6 +300,7 @@ export default {
       this.itemSn = row.productSn
       this.openPriceAuditModal = true
     },
+    // 价格审核成功
     auditSuccess () {
       this.$refs.table.clearSelected() // 清空表格选中项
       this.$refs.table.refresh()
@@ -344,12 +352,14 @@ 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 - 240
@@ -380,6 +390,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 1 - 1
src/views/purchasingManagement/purchaseReceipt/edit.vue

@@ -61,7 +61,7 @@
             type="primary"
             class="button-warning"
             :loading="loading"
-            @click="handleQueryQty">查询库存</a-button>
+            @click="handleQueryQty">第三方库存</a-button>
           <a-alert type="info">
             <div slot="message" class="total-bar">
               <span>采购数量:{{ statisticsObj && (statisticsObj.qty || statisticsObj.qty == 0) ? statisticsObj.qty : '--' }};</span>

+ 25 - 11
src/views/purchasingManagement/purchaseReceipt/list.vue

@@ -122,25 +122,31 @@
               @click="handleDel(record)"
               class="button-error"
               id="purchaseReceiptList-del-btn">取消</a-button>
+            <a-tooltip placement="left">
+              <template slot="title">
+                <span>物流单号:123456789</span>
+              </template>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
+                id="purchaseReceiptList-logistics-btn">
+                物流
+              </a-button>
+            </a-tooltip>
             <a-button
               size="small"
               type="link"
               class="button-warning"
-              @click="handleCheck(record)"
-              v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
-              id="purchaseReceiptList-logistics-btn">物流</a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-warning"
-              @click="handleCheck(record)"
+              @click="addVoucher(record)"
               v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
               id="purchaseReceiptList-addVoucher-btn">上传凭证</a-button>
             <a-button
               size="small"
               type="link"
               class="button-warning"
-              @click="handleCheck(record)"
+              @click="seeVoucher(record)"
               v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
               id="purchaseReceiptList-seeVoucher-btn">查看凭证</a-button>
           </template>
@@ -150,6 +156,8 @@
       <detailModal v-drag :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
       <!-- 审核弹窗 -->
       <reviewModal v-drag :openModal="openReviewModal" @close="openReviewModal=false"></reviewModal>
+      <!-- 上传凭证 -->
+      <uploadVoucherModal v-drag :openModal="openVoucherModal" @close="openVoucherModal=false"></uploadVoucherModal>
     </a-card>
   </div>
 </template>
@@ -164,12 +172,13 @@ import supplier from '@/views/common/supplier.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import reviewModal from './reviewModal.vue'
 import detailModal from './detailModal.vue'
+import uploadVoucherModal from './uploadVoucherModal.vue'
 // 接口
-import { sparePartsReturnList, sparePartsReturnDelete, sparePartsReturnExportDetail, againSubmit } from '@/api/sparePartsReturn'
+import { sparePartsReturnList, sparePartsReturnDelete } from '@/api/sparePartsReturn'
 export default {
   name: 'PurchaseReceiptList',
   mixins: [commonMixin],
-  components: { STable, supplier, VSelect, custList, rangeDate, warehouse, reviewModal, detailModal },
+  components: { STable, supplier, VSelect, custList, rangeDate, warehouse, reviewModal, detailModal, uploadVoucherModal },
   data () {
     return {
       spinning: false,
@@ -187,6 +196,7 @@ export default {
         state: undefined
       },
       openReviewModal: false, // 审核弹窗
+      openVoucherModal: false, // 上传凭证
       openDetailModal: false, // 详情弹窗
       itemSn: null, // 采购入库sn
       totalData: null, // 统计数据
@@ -261,6 +271,10 @@ export default {
     closeDetailModal () {
       this.openDetailModal = false
     },
+    // 上传凭证
+    addVoucher () {
+      this.openVoucherModal = true
+    },
     //  取消
     handleDel (row) {
       const _this = this

+ 170 - 0
src/views/purchasingManagement/purchaseReceipt/uploadVoucherModal.vue

@@ -0,0 +1,170 @@
+<template>
+  <a-modal
+    centered
+    class="uploadVoucher-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="上传支付凭证"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="420">
+    <div class="uploadVoucher-con">
+      <div class="explain-con">
+        <div style="overflow: hidden;padding-left: 23px;">
+          <Upload
+            id="uploadVoucher-attachList"
+            ref="importUpload"
+            :maxNums="1"
+            fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+            uploadType="import"
+            :action="attachAction"
+            :uploadParams="uploadParams"
+            upText="添加文件"
+            @change="changeImport"></Upload>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          id="uploadVoucher-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="margin-right: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="uploadVoucher-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep">保存</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'UploadVoucherModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      },
+      exportLoading: false,
+      filePath: location.protocol + '//' + location.host + '/templ/采购产品导入模板.xlsx'
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          sparePartsSn: this.params.sparePartsSn || '',
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .uploadVoucher-modal{
+    .uploadVoucher-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #uploadVoucher-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>