Explorar o código

添加注释 id

chenrui hai 11 meses
pai
achega
9366c90816

+ 11 - 4
src/views/productManagement/productBrand/detailModal.vue

@@ -14,7 +14,13 @@
         <a-descriptions-item label="品牌分类:">{{ detailsData&&detailsData.brandTypeDictValue || '--' }}</a-descriptions-item>
         <a-descriptions-item label="排序字母:">{{ detailsData&&detailsData.sortChar || '--' }}</a-descriptions-item>
         <a-descriptions-item label="品牌图片:">
-          <img v-if="detailsData&&detailsData.imageUrl" :src="detailsData.imageUrl" title="点击查看大图" class="productPic" @click="getPreview(detailsData.imageUrl)" />
+          <img
+            id="productBrandDetail-imageUrl"
+            v-if="detailsData&&detailsData.imageUrl"
+            :src="detailsData.imageUrl"
+            title="点击查看大图"
+            class="productPic"
+            @click="getPreview(detailsData.imageUrl)" />
           <span v-else>--</span>
         </a-descriptions-item>
         <a-descriptions-item label="品牌介绍:">
@@ -31,6 +37,7 @@
 </template>
 
 <script>
+// 接口
 import { productBrandSnDetail } from '@/api/productBrand'
 export default {
   name: 'ProductBrandDetailModal',
@@ -39,7 +46,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: {// 当前产品品牌sn
       type: [Number, String],
       default: ''
     }
@@ -48,8 +55,8 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       detailsData: null, //  详情数据
-      previewVisible: false,
-      previewImage: ''
+      previewVisible: false, // 打开品牌图片预览弹窗
+      previewImage: ''// 当前品牌预览图片
     }
   },
   methods: {

+ 17 - 11
src/views/productManagement/productBrand/editModal.vue

@@ -52,17 +52,19 @@
       </a-spin>
     </div>
     <div class="btn-cont">
-      <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
-      <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">保存</a-button>
+      <a-button id="productBrandEdit-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+      <a-button type="primary" id="productBrandEdit-save" @click="handleSave">保存</a-button>
     </div>
   </a-modal>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
 import dataList from '@/libs/commonData'
+// 接口
 import { productBrandSnDetail, productBrandSave } from '@/api/productBrand'
 export default {
   name: 'ProductBrandEditModal',
@@ -73,36 +75,40 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: {// 当前产品品牌sn
       type: [Number, String],
       default: ''
     },
-    nowData: {
+    nowData: {// 当前产品品牌信息
       type: Object,
       default: null
     }
   },
   computed: {
+    // 弹框标题
     modalTit () {
       return (this.itemSn ? '编辑' : '新增') + '产品品牌'
     }
   },
   data () {
     return {
-      sortCharList: dataList.sortCharList,
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      sortCharList: dataList.sortCharList, // 排序字符数据
+      isShow: this.openModal, //  是否打开弹框
+      // label 表单 布局设置
       formItemLayout: {
         labelCol: { span: 3 },
         wrapperCol: { span: 19 }
       },
+      // 表单数据
       form: {
         brandName: '', // 品牌名称
-        brandType: undefined,
-        sortChar: undefined,
-        imageUrl: '',
-        brandIntroduce: ''
+        brandType: undefined, // 品牌分类
+        sortChar: undefined, // 排序字母
+        imageUrl: '', // 品牌图片
+        brandIntroduce: ''// 品牌介绍
       },
+      // 表单验证规则
       rules: {
         brandName: [
           { required: true, message: '请输入品牌名称', trigger: 'blur' }
@@ -120,7 +126,7 @@ export default {
     }
   },
   methods: {
-    //  详情
+    //  获取详情数据
     getDetail () {
       productBrandSnDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {

+ 19 - 6
src/views/productManagement/productBrand/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="productBrandList-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="productBrandList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="品牌名称">
@@ -51,7 +51,13 @@
           bordered>
           <!-- 产品图片 -->
           <template slot="imageUrl" slot-scope="text, record">
-            <img :src="record.imageUrl+'?x-oss-process=image/resize,h_30,m_lfit' || ''" width="30" height="30" class="imageUrl" @click="lookPic(record.imageUrl)" />
+            <img
+              id="productBrandList-imageUrl"
+              :src="record.imageUrl+'?x-oss-process=image/resize,h_30,m_lfit' || ''"
+              width="30"
+              height="30"
+              class="imageUrl"
+              @click="lookPic(record.imageUrl)" />
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
@@ -108,10 +114,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import dataList from '@/libs/commonData'
 import productBrandEditModal from './editModal.vue'
 import productBrandDetailModal from './detailModal.vue'
+// 接口
 import { productBrandList, productBrandDel } from '@/api/productBrand'
 export default {
   name: 'ProductBrandList',
@@ -120,14 +128,15 @@ export default {
   data () {
     return {
       spinning: false,
-      sortCharList: dataList.sortCharList,
-      tableHeight: 0,
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      //  查询条件
+      queryParam: {
         brandName: '', //  品牌名称
         brandType: undefined,
         sortChar: undefined
       },
-      disabled: false, //  查询、重置按钮是否可操作
+      sortCharList: dataList.sortCharList, // 排序字母
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -141,10 +150,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取表格数据 有分页
         return productBrandList(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
@@ -219,12 +230,14 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 10 - 3
src/views/productManagement/productCategory/editModal.vue

@@ -43,7 +43,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
+// 接口
 import { productTypeSave } from '@/api/productType'
 export default {
   name: 'ProductCategoryEditModal',
@@ -54,31 +56,35 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: {// 当前分类sn
       type: [Number, String],
       default: ''
     },
-    nowData: {
+    nowData: {// 当前分类数据信息
       type: Object,
       default: null
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.itemSn ? '编辑' : '新增') + '产品分类'
     }
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // 表单布局设置
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      // 表单数据
       form: {
         productTypeName: '' // 产品分类名称
       },
+      // 表单验证规则
       rules: {
         productTypeName: [
           { required: true, message: '请输入产品分类名称', trigger: 'blur' }
@@ -88,6 +94,7 @@ export default {
     }
   },
   methods: {
+    // 筛选符合格式的产品分类名称
     filterEmpty () {
       let str = this.form.productTypeName
       str = str.replace(/\ +/g, '')

+ 6 - 2
src/views/productManagement/productCategory/list.vue

@@ -61,9 +61,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { productTypeQuery, productTypeDel } from '@/api/productType'
+// 组件
 import { STable } from '@/components'
 import productCategoryEditModal from './editModal.vue'
+// 接口
+import { productTypeQuery, productTypeDel } from '@/api/productType'
 export default {
   name: 'ProductCategoryList',
   mixins: [commonMixin],
@@ -71,7 +73,8 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      // label 标签布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
@@ -87,6 +90,7 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 190
         }
+        // 获取列表数据 无分页
         return productTypeQuery({}).then(res => {
           let data
           if (res.status == 200) {

+ 7 - 4
src/views/productManagement/productLevel/editModal.vue

@@ -39,7 +39,9 @@
 </template>
 
 <script>
+// 组件
 import { VSelect } from '@/components'
+// 接口
 import { productLevelSave } from '@/api/product'
 export default {
   name: 'ProductLevelEditModal',
@@ -49,11 +51,11 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemId: {// 当前产品级别id
       type: [Number, String],
       default: ''
     },
-    nowData: {
+    nowData: {// 当前产品级别信息
       type: Object,
       default: () => {
         return {}
@@ -62,14 +64,15 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // label 标签布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
       form: {
-        level: undefined
+        level: undefined// 产品级别
       },
       rules: {
         level: [

+ 18 - 33
src/views/productManagement/productLevel/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="productLevelList-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="productLevelList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品名称">
@@ -16,9 +16,9 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品分类">
+              <a-form-item label="产品分类">
                 <ProductType id="productLevelList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
-              </a-form-model-item>
+              </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
@@ -44,11 +44,6 @@
         </a-form>
       </div>
     </a-card>
-    <!-- 操作按钮 -->
-    <!-- <div class="table-operator" style="margin-bottom: 10px;">
-      <a-button id="productLevelList-import" type="primary" @click="handleImport">导入</a-button>
-      <a-button style="margin-left: 5px" id="productLevelList-export" type="danger" @click="handleExport" :loading="exportLoading">导出</a-button>
-    </div> -->
     <!-- 列表 -->
     <a-card size="small" :bordered="false">
       <s-table
@@ -81,13 +76,7 @@
         </template>
       </s-table>
       <!-- 编辑价格 -->
-      <product-level-edit-modal
-        v-drag
-        :openModal="openModal"
-        :itemId="itemId"
-        :nowData="nowData"
-        @close="closeModal"
-        @ok="$refs.table.refresh()" />
+      <product-level-edit-modal v-drag :openModal="openModal" :itemId="itemId" :nowData="nowData" @close="closeModal" @ok="$refs.table.refresh()" />
     </a-card>
   </div>
 </template>
@@ -95,10 +84,12 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+//组件
 import { STable, VSelect } from '@/components'
 import productLevelEditModal from './editModal.vue'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
+//接口
 import { productLevelList } from '@/api/product'
 export default {
   name: 'ProductLevelList',
@@ -107,19 +98,20 @@ export default {
   data () {
     return {
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
+      tableHeight: 0,//表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      //  查询条件
+      queryParam: { 
         name: '', //  产品名称
         queryWord: '', // 产品编码/原厂编码
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        level: undefined
+        level: undefined //产品级别
       },
-      productType: [],
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
+      productType: [],//产品分类
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品名称', dataIndex: 'name', align: 'left', width: '25%', ellipsis: true, customRender: function (text) { return text || '--' } },
@@ -158,7 +150,7 @@ export default {
       itemId: '', //  当前产品id
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
-      nowData: null
+      nowData: null //当前行数据
     }
   },
   methods: {
@@ -192,17 +184,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    // 导入
-    handleImport () {},
-    //  导出
-    handleExport () {
-      const params = this.queryParam
-      this.exportLoading = true
-      // customerBundleExportDelay(params).then(res => {
-      //   this.exportLoading = false
-      //   this.download(res)
-      // })
-    },
+    //导出配置
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))
@@ -215,18 +197,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 - 200
     }
   },
   watch: {
+    //展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

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

@@ -82,6 +82,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { codeExportImportError } from '@/api/reportData'
 export default {
   name: 'ChooseImportModal',
@@ -91,7 +92,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: {// 导入数据
       type: Object,
       default: () => {
         return {}
@@ -108,7 +109,7 @@ export default {
         { title: '业务单号', dataIndex: 'bizCode', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '工厂出库单号', dataIndex: 'factoryOutNo', width: '26%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
+      loadData: [], // 可导入信息
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -117,9 +118,9 @@ export default {
         { title: '工厂出库单号', dataIndex: 'factoryOutNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorDesc', width: '27%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      unLoadData: [],
-      loading: false,
-      countData: []
+      unLoadData: [], // 不可导入信息
+      loading: false, // 表格加载状态
+      countData: []// 导入条数统计
     }
   },
   methods: {
@@ -156,6 +157,7 @@ export default {
         this.countData = mergedObjects
       }
     },
+    // 获取 重复导入数据 有重复true  没有返回false
     compareObjects (obj1, obj2) {
       return Object.keys(obj1).every(key => obj1[key] === obj2[key])
     },

+ 8 - 7
src/views/productManagement/productSourcePath/importGuideModal.vue

@@ -21,7 +21,7 @@
             <li>4) 业务单号需是系统中已审核通过的销售单和调拨单</li>
             <li>5) “工厂出库单号”非必填,可重复,可为空</li>
             <li>
-              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+              <a id="importGuide-download" :href="filePath" style="margin: 5px 0 0;display: block;">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板
               </a>
             </li>
@@ -70,6 +70,7 @@
 </template>
 
 <script>
+// 组件
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
 export default {
@@ -88,14 +89,14 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/report/tracecode/importParse',
-      paramsData: null,
-      uploadParams: {
+      openImportModal: false, //  下一步  打开导入详情预览弹窗
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/report/tracecode/importParse', // 上传地址
+      paramsData: null, // 导入数据
+      uploadParams: {// 上传数据
         savePathType: 'local'
       },
-      exportLoading: false,
-      filePath: location.protocol + '//' + location.host + '/templ/唯一码导入模板.xlsx'
+      exportLoading: false, // 导出按钮加载状态
+      filePath: location.protocol + '//' + location.host + '/templ/唯一码导入模板.xlsx'// 下载模板地址
     }
   },
   methods: {

+ 51 - 43
src/views/productManagement/productSourcePath/list.vue

@@ -1,10 +1,10 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="tireSalesReportList-wrap searchBox">
+    <a-card size="small" :bordered="false" class="productSourceList-wrap searchBox">
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch">
-        <a-form-model
-          id="tireSalesReportList-form"
+        <a-form
+          id="productSourceList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -12,9 +12,9 @@
           @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="审核时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-              </a-form-model-item>
+              <a-form-item label="审核时间">
+                <rangeDate ref="rangeDate" id="productSourceList-time" :value="time" @change="dateChange" />
+              </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="业务单号">
@@ -45,8 +45,8 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="单据类型">
-                  <a-select @change="handleBizStatus" v-model="queryParam.bizStatus" placeholder="请选择单据类型" allowClear>
+                <a-form-item label="单据类型">
+                  <a-select @change="handleBizStatus" id="productSourceList-bizStatus" v-model="queryParam.bizStatus" placeholder="请选择单据类型" allowClear>
                     <a-select-option value="XS">
                       销售单
                     </a-select-option>
@@ -54,7 +54,7 @@
                       调拨单
                     </a-select-option>
                   </a-select>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品名称">
@@ -66,24 +66,17 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="客户名称">
+                <a-form-item label="客户名称">
                   <a-input
                     id="productSourceList-buyerName"
                     v-model.trim="queryParam.buyerName"
                     allowClear
                     placeholder="请输入客户名称" />
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="质保状态">
-                  <!-- <v-select
-                    v-model="queryParam.dealerLevel"
-                    ref="dealerLevel"
-                    id="productSourceList-dealerLevel"
-                    code="DEALER_LEVEL"
-                    placeholder="请选择质保状态"
-                    allowClear></v-select> -->
-                  <a-select v-model="queryParam.warrantyState" placeholder="请选择质保状态" allowClear>
+                <a-form-item label="质保状态">
+                  <a-select v-model="queryParam.warrantyState" id="productSourceList-warrantyState" placeholder="请选择质保状态" allowClear>
                     <a-select-option value="NOTSTART">
                       未开始
                     </a-select-option>
@@ -94,7 +87,7 @@
                       已过期
                     </a-select-option>
                   </a-select>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align: center;">
@@ -118,14 +111,14 @@
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_productSourceExport')"
                 id="productSourceList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="productSourceList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'" />
               </a>
             </a-col>
           </a-row>
-        </a-form-model>
-      </div>
+          </a-form-model>
+        </a-form></div>
     </a-card>
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
@@ -133,7 +126,7 @@
         <div style="display:flex;align-items:center;margin-bottom:10px;">
           <a-button
             type="primary"
-            id="outboundOrder-export"
+            id="productSourceList-import-btn"
             :loading="loading"
             v-if="$hasPermissions('B_productSourceImport')"
             @click="openGuideModal = true">导入</a-button>
@@ -163,7 +156,13 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button v-if="$hasPermissions('B_productSourceSeeInfo')&&record.warrantyState!='NOTSTART'" size="small" type="link" class="button-warning" @click="handleInfoModal(record)">质保信息</a-button>
+            <a-button
+              id="productSourceList-info"
+              v-if="$hasPermissions('B_productSourceSeeInfo')&&record.warrantyState!='NOTSTART'"
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleInfoModal(record)">质保信息</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -178,12 +177,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import warrantyInfoModal from './warrantyInfoModal.vue'
 import importGuideModal from './importGuideModal.vue'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { traceCodeInsertBatch, traceCodeQueryCount, traceCodeList, excelOnlineList } from '@/api/reportData'
 export default {
   name: 'ProductSourceList',
@@ -191,24 +192,27 @@ export default {
   components: { STable, VSelect, rangeDate, warrantyInfoModal, importGuideModal },
   data () {
     return {
-      loading: false,
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      loading: false, // 表格加载状态
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      // 审核时间
       time: [
         getDate.getThreeMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
       queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        productCode: '',
-        productName: '',
-        bizCode: undefined,
-        traceCode: undefined,
-        buyerName: undefined,
-        bizStatus: undefined,
-        warrantyState: undefined
+        beginDate: getDate.getThreeMonthDays().starttime, // 审核开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 审核结束时间
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        bizCode: undefined, // 业务单号
+        traceCode: undefined, // 唯一码
+        buyerName: undefined, // 客户名称
+        bizStatus: undefined, // 单据类型
+        warrantyState: undefined// 质保状态
       },
       openInfoModal: false, // 质保信息弹窗
       columns: [{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -223,18 +227,19 @@ export default {
         { title: '质保时间', scopedSlots: { customRender: 'warrantyTime' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ],
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
+        // 获取表格数据 有分页
         return traceCodeList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 获取统计数据
             this.getCount(params)
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -245,13 +250,14 @@ export default {
           return data
         })
       },
-      totalData: null,
+      totalData: null, // 统计数据
       openGuideModal: false, // 导入弹窗
-      warrantyInfoId: null,
-      productCodeInfo: null
+      warrantyInfoId: null, // 质保信息id
+      productCodeInfo: null// 当前行产品编码
     }
   },
   watch: {
+    // 展开/关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -338,12 +344,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 - 247

+ 2 - 3
src/views/productManagement/productSourcePath/warrantyInfoModal.vue

@@ -36,9 +36,8 @@
               </a-descriptions-item>
             </a-descriptions>
           </div>
-          <div class="imgBox">
+          <div class="imgBox" v-if="detailsData&&detailsData.productMsg">
             <img
-              v-if="detailsData.productMsg"
               style="margin-bottom:6px;object-fit: cover;border:1px dashed #ccc;"
               :src="detailsData.productMsg"
               alt="图片走丢啦"
@@ -102,7 +101,7 @@
     </a-spin>
     <!-- 查看图片 -->
     <a-modal v-model="openImgModal" :title="null" :footer="null" :width="600" centered>
-      <div class="viewImg">
+      <div class="viewImg" v-if="detailsData&&detailsData.productMsg">
         <img
           :src="detailsData.productMsg"
           alt="图片走丢啦"

+ 3 - 1
src/views/productManagement/productUniversal/editModal.vue

@@ -94,17 +94,19 @@ export default {
     }
   },
   methods: {
+    // 产品编码 change
     productCodeChange (val) {
       this.form.productSn = val.key || undefined
       this.form.productCode = val.row && val.row.code ? val.row.code : undefined
       this.productName = val.row && val.row.name ? val.row.name : undefined
     },
+    // 通用产品编码 change
     productUniversalCodeChange (val) {
       this.form.productCommonSn = val.key || undefined
       this.form.productCommonCode = val.row && val.row.code ? val.row.code : undefined
       this.productCommonName = val.row && val.row.name ? val.row.name : undefined
     },
-    // 详情
+    // 获取详情数据
     getDetail () {
       productUniversalCodeDetail({ id: this.itemId }).then(res => {
         if (res.status == 200) {

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

@@ -61,7 +61,7 @@
             type="primary"
             class="button-warning"
             :loading="loading"
-            @click="handleQueryQty">第三方库存</a-button>
+            @click="handleThirdQty">第三方库存</a-button>
           <a-alert type="info">
             <div slot="message" class="total-bar">
               <span>采购数量:{{ statisticsObj && (statisticsObj.qty || statisticsObj.qty == 0) ? statisticsObj.qty : '--' }};</span>
@@ -149,6 +149,7 @@ import {
   sparePartsReturnInfo,
   sparePartsReturnDetailSaveBatch
 } from '@/api/sparePartsReturn'
+import { getThirdStockQty } from '@/api/salesNew'
 export default {
   name: 'PurchaseReturnEdit',
   mixins: [commonMixin],
@@ -286,6 +287,17 @@ export default {
     }
   },
   methods: {
+    // 第三方库存
+    handleThirdQty () {
+      const params = {
+        sparePartsSn: this.sparePartsSn
+      }
+      getThirdStockQty(params).then(res => {
+        if (res.status == 200) {
+
+        }
+      })
+    },
     // 编辑基础信息
     handleEditBase () {
       this.openBasicInfoModal = true