Browse Source

完善id和注释

lilei 11 tháng trước cách đây
mục cha
commit
32e6263721

+ 1 - 8
src/views/supplierManagement/associatedProduct/add.vue

@@ -50,7 +50,6 @@
             class="button-info"
             @click="openGuideModal=
               true">导入产品</a-button>
-        <!-- <a-button id="associatedProduct-import-btn" type="primary" class="button-success">批量导入</a-button> -->
         </div>
         <!-- 列表 -->
         <s-table
@@ -71,12 +70,6 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <!-- <a-button
-              size="small"
-              type="link"
-              class="button-info"
-              @click="handleSetPrice(record)"
-              id="associatedProduct-setCostPrice-btn">设置成本价</a-button> -->
             <a-button
               size="small"
               type="link"
@@ -114,7 +107,7 @@ export default {
       spinning: false,
       disabled: false,
       advanced: true,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       openModal: false, // 设置价格 弹框
       newProduct: false, // 选择产品 弹框
       queryParam: { //  查询条件

+ 10 - 7
src/views/supplierManagement/associatedProduct/settingCost.vue

@@ -36,10 +36,10 @@
               style="width: 100%;" />
           </a-form-model-item>
           <div style="display: flex;justify-content: center;padding: 30px 0;">
-            <a-button type="primary" @click="onSubmit">
+            <a-button type="primary" @click="onSubmit" id="setting-cost-submit">
               确定
             </a-button>
-            <a-button style="margin-left: 15px;" @click="cansel">
+            <a-button style="margin-left: 15px;" @click="cansel" id="setting-cost-cancel">
               取消
             </a-button>
           </div>
@@ -70,12 +70,12 @@ export default {
       title: '设置成本价',
       labelCol: { span: 4 },
       wrapperCol: { span: 18 },
-      productName: '',
-      productCode: '',
+      productName: '', // 产品名称
+      productCode: '', // 产品编码
       form: {
-        supplierSn: '',
-        supplierProductSn: '',
-        cost: ''
+        supplierSn: '', // 供应商sn
+        supplierProductSn: '', // 产品sn
+        cost: '' // 成本
       },
       rules: {
         cost: [
@@ -85,6 +85,7 @@ export default {
     }
   },
   methods: {
+    // 设置数据
     setData (row) {
       this.form.supplierSn = row.supplierSn
       this.form.supplierProductSn = row.supplierProductSn
@@ -92,6 +93,7 @@ export default {
       this.productName = row.product.name
       this.productCode = row.product.code
     },
+    // 保存
     onSubmit () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -113,6 +115,7 @@ export default {
         }
       })
     },
+    // 取消
     cansel () {
       this.$emit('close')
       this.productName = ''

+ 5 - 5
src/views/supplierManagement/associatedProductDetails/list.vue

@@ -84,9 +84,9 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
-        supplierName: '',
+        supplierName: '', // 供应商名称
         product: {
           name: '', //  产品名称
           queryWord: '', // 产品编码/原厂编码
@@ -97,7 +97,7 @@ export default {
         }
       },
       disabled: false, //  查询、重置按钮是否可操作
-      productType: [],
+      productType: [], // 产品分类
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -129,7 +129,7 @@ export default {
         { title: '产品名称', dataIndex: 'product.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'product.code', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'product.origCode', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '成本价', dataIndex: 'cost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ]
       return arr
     }
@@ -147,7 +147,7 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
-    //  产品分类  change
+    //  选择产品分类  change
     changeProductType (val, opt) {
       this.queryParam.product.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''

+ 4 - 2
src/views/supplierManagement/costSetRecord/list.vue

@@ -91,7 +91,7 @@ export default {
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        supplierName: '',
+        supplierName: '', // 供应商名称
         product: {
           name: '', //  产品名称
           queryWord: '', // 产品编码/原厂编码
@@ -115,7 +115,7 @@ export default {
 
       ],
       disabled: false, //  查询、重置按钮是否可操作
-      productType: [],
+      productType: [], // 产品分类默认值
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -166,12 +166,14 @@ export default {
       this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.product.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 - 200

+ 11 - 6
src/views/supplierManagement/costSetting/addProductModal.vue

@@ -13,7 +13,13 @@
         <div style="display:flex;align-items: center;padding:10px 0;">
           <div style="font-size:14px;"><span style="color:red;">*</span>供应商名称:</div>
           <div style="flex-grow: 1;">
-            <supplier style="width:50%" ref="supplier" v-model="supplierSn" @change="getChoosed" placeholder="请输入供应商名称搜索"></supplier>
+            <supplier
+              id="chooseProducts-supplier"
+              style="width:50%"
+              ref="supplier"
+              v-model="supplierSn"
+              @change="getChoosed"
+              placeholder="请输入供应商名称搜索"></supplier>
           </div>
         </div>
         <div style="padding:10px 0;border-bottom: 1px solid #eee;">
@@ -110,7 +116,7 @@ export default {
       type: String,
       default: 'supplier'
     },
-    dealerSn: {
+    dealerSn: { // 经销商sn
       type: String || Number,
       default: ''
     }
@@ -127,7 +133,7 @@ export default {
       queryParam: { //  查询条件
         code: '', //  产品编码
         productBrandSn: undefined, //  产品品牌
-        productType: [],
+        productType: [], // 产品分类默认值
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
@@ -206,12 +212,10 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.productType = []
-      // this.supplierSn = undefined  //供应商sn
     },
     //  重置
     resetSearchForm () {
       this.resetData()
-      // this.$refs.table.clearTable()
       this.$refs.table.refresh(true)
     },
     // 保存
@@ -251,7 +255,7 @@ export default {
         this.spinning = false
       })
     },
-    //  产品分类  change
+    //  选择产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
@@ -267,6 +271,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置数据
         this.$refs.table.clearTable()
         this.chooseData = []
         this.supplierSn = undefined

+ 5 - 3
src/views/supplierManagement/costSetting/chooseImportModal.vue

@@ -77,7 +77,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: Object,
       default: () => {
         return {}
@@ -103,8 +103,8 @@ export default {
         { title: '成本价', dataIndex: 'costText', width: '15%', align: 'right', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'importErrorMsgList', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
-      unLoadData: [],
+      loadData: [], // 正确数据
+      unLoadData: [], // 错误数据
       loading: false
     }
   },
@@ -115,12 +115,14 @@ export default {
       supplierProductParseNewProducts(this.paramsData).then(res => {
         this.loading = false
         if (res.status == 200) {
+          // 正确数据
           if (res.data.okList && res.data.okList.length > 0) {
             res.data.okList.map((item, index) => {
               item.no = index + 1
               item.costText = item.costText instanceof Number ? Number(item.costText).toFixed(2) : item.costText
             })
           }
+          // 错误数据
           if (res.data.failList && res.data.failList.length > 0) {
             res.data.failList.map((item, index) => {
               item.no = index + 1

+ 13 - 6
src/views/supplierManagement/costSetting/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-tpl"
+            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">
@@ -74,7 +80,7 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
+    params: { // 参数
       type: Object,
       default: null
     }
@@ -83,12 +89,12 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传接口
+      paramsData: null, // 参数
       uploadParams: {
-        savePathType: 'local'
+        savePathType: 'local' // 文件上传位置
       },
-      exportLoading: false
+      exportLoading: false // loading
     }
   },
   methods: {
@@ -143,6 +149,7 @@ export default {
         }
       })
     },
+    // 下载模板文件
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))

+ 17 - 11
src/views/supplierManagement/costSetting/list.vue

@@ -62,9 +62,9 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator">
-          <a-button type="primary" v-if="$hasPermissions('B_costSetAddProduct')" @click="newProduct=true">新增</a-button>
-          <a-button type="primary" v-if="$hasPermissions('B_costSetBatchImport')" class="button-warning" @click="handleBatchImport">批量导入</a-button>
-          <a-button type="primary" ghost v-if="$hasPermissions('B_costSetAudit')" @click="handleBatchAudit">批量审核</a-button>
+          <a-button id="costSetDetailList-new" type="primary" v-if="$hasPermissions('B_costSetAddProduct')" @click="newProduct=true">新增</a-button>
+          <a-button id="costSetDetailList-import" type="primary" v-if="$hasPermissions('B_costSetBatchImport')" class="button-warning" @click="handleBatchImport">批量导入</a-button>
+          <a-button id="costSetDetailList-paudit" type="primary" ghost v-if="$hasPermissions('B_costSetAudit')" @click="handleBatchAudit">批量审核</a-button>
         </div>
         <!-- 列表 -->
         <s-table
@@ -91,6 +91,7 @@
           <template slot="action" slot-scope="text, record">
             <div>
               <a-button
+                :id="'costSetDetailList-audit-'+record.id"
                 size="small"
                 type="link"
                 class="button-warning"
@@ -98,6 +99,7 @@
                 @click="handleAudit([record.supplierProductSn])"
               >审核</a-button>
               <a-button
+                :id="'costSetDetailList-editcost-'+record.id"
                 size="small"
                 type="link"
                 class="button-warning"
@@ -105,6 +107,7 @@
                 @click="handleCostSet(record,editFlag = true)"
               >编辑成本</a-button>
               <a-button
+                :id="'costSetDetailList-setcost-'+record.id"
                 size="small"
                 type="link"
                 class="button-warning"
@@ -145,8 +148,8 @@ export default {
       spinning: false,
       exportLoading: false,
       advanced: true, // 高级搜索 展开/关闭
-      openGuideModal: false,
-      tableHeight: 0,
+      openGuideModal: false, // 导入指导弹窗
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
         supplierName: '',
         product: {
@@ -157,7 +160,7 @@ export default {
           productTypeSn2: '', //  产品二级分类
           productTypeSn3: '' //  产品三级分类
         },
-        auditState: undefined
+        auditState: undefined // 审核状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       productType: [],
@@ -179,10 +182,10 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null,
-      newProduct: false,
-      openSetModal: false,
-      editFlag: false
+      rowSelectionInfo: null, // 已选数据
+      newProduct: false, // 新增弹框
+      openSetModal: false, // 设置弹框
+      editFlag: false // 是否编辑
     }
   },
   computed: {
@@ -232,7 +235,7 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
-    //  产品分类  change
+    //  选择产品分类  change
     changeProductType (val, opt) {
       this.queryParam.product.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
@@ -288,6 +291,7 @@ export default {
         }
       })
     },
+    // 提交审核
     auditOrder (sn, val) {
       this.spinning = true
       supplierProductUpdateAuditState({
@@ -308,12 +312,14 @@ export default {
       this.editFlag = !!flag
       this.$refs.settingCost.setData(row)
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 14 - 11
src/views/supplierManagement/costSetting/settingCost.vue

@@ -42,10 +42,10 @@
               style="width: 100%;" />
           </a-form-model-item>
           <div style="display: flex;justify-content: center;padding: 30px 0;">
-            <a-button style="margin-right: 15px;" @click="cansel">
+            <a-button style="margin-right: 15px;" @click="cansel" id="setting-cost-cancel">
               取消
             </a-button>
-            <a-button type="primary" @click="onSubmit">
+            <a-button type="primary" @click="onSubmit" id="setting-cost-submit">
               确定
             </a-button>
           </div>
@@ -68,7 +68,7 @@ export default {
       type: Boolean,
       default: false
     },
-    edit: {
+    edit: { // 是否编辑
       type: Boolean,
       default: false
     }
@@ -77,17 +77,17 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
-      title: '设置成本价',
+      title: '设置成本价', // 标题
       labelCol: { span: 4 },
       wrapperCol: { span: 18 },
-      productName: '',
-      productCode: '',
-      supplierName: '',
-      cost: '',
+      productName: '', // 产品名称
+      productCode: '', // 产品编码
+      supplierName: '', // 供应商名称
+      cost: '', // 成本
       form: {
-        supplierSn: '',
-        supplierProductSn: '',
-        modifyCost: ''
+        supplierSn: '', // 供应商sn
+        supplierProductSn: '', // 产品sn
+        modifyCost: '' // 最新成本
       },
       rules: {
         modifyCost: [
@@ -97,6 +97,7 @@ export default {
     }
   },
   methods: {
+    // 编辑时设置数据
     setData (row) {
       this.form.supplierSn = row.supplierSn
       this.form.supplierProductSn = row.supplierProductSn
@@ -109,6 +110,7 @@ export default {
         _this.form.modifyCost = _this.edit ? row.modifyCost : ''
       })
     },
+    // 保存
     onSubmit () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -134,6 +136,7 @@ export default {
         }
       })
     },
+    // 取消操作,并重置表单
     cansel () {
       this.$emit('close')
       this.productName = ''

+ 29 - 28
src/views/supplierManagement/supplierInfo/edit.vue

@@ -136,7 +136,7 @@
                 </a-col>
                 <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
                   <a-form-model-item label="ERP编码">
-                    <a-input v-model.trim="form.kdSupplierCode" :maxLength="50" allowClear placeholder="请输入ERP编码" />
+                    <a-input id="supplierInfoEdit-erpcode" v-model.trim="form.kdSupplierCode" :maxLength="50" allowClear placeholder="请输入ERP编码" />
                   </a-form-model-item>
                 </a-col>
               </a-row>
@@ -278,30 +278,30 @@ export default {
         }
       },
       form: {
-        supplierName: '',
-        contact: '',
-        contactMobile: '',
-        contactRole: '',
-        supplierTelephone: '',
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
-        address: '',
-        produceCycle: '',
-        deliveryCycle: '',
-        settleCycle: '',
-        cooperateFlag: undefined,
-        kdSupplierCode:'',
-        busniessMode: '',
-        busniessScope: '',
-        buildDate: '',
-        tradeAccountName: '',
-        tradeBankName: '',
-        tradeBankAccount: '',
-        contact2: '',
-        contactMobile2: '',
-        contactRole2: '',
-        remark: ''
+        supplierName: '', // 供应商名称
+        contact: '', // 联系人1
+        contactMobile: '', // 联系人1手机
+        contactRole: '', // 联系人1角色
+        supplierTelephone: '', // 供应商电话
+        provinceSn: undefined, // 省
+        citySn: undefined, // 市
+        districtSn: undefined, // 区
+        address: '', // 详细地址
+        produceCycle: '', // 生产周期(天)
+        deliveryCycle: '', // 交货周期(天)
+        settleCycle: '', // 结算周期(天)
+        cooperateFlag: undefined, // 是否合作
+        kdSupplierCode: '', // 快递供应商编码
+        busniessMode: '', // 经营模式
+        busniessScope: '', // 经营范围
+        buildDate: '', // 成立日期
+        tradeAccountName: '', // 贸易账号名称
+        tradeBankName: '', // 贸易账号开户行
+        tradeBankAccount: '', // 贸易账号账号
+        contact2: '', // 联系人2
+        contactMobile2: '', // 联系人2手机
+        contactRole2: '', // 联系人2角色
+        remark: '' // 备注
       },
       rules: {
         supplierName: [
@@ -339,11 +339,11 @@ export default {
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      dateFormat: 'YYYY-MM-DD'
+      dateFormat: 'YYYY-MM-DD' // 日期格式
     }
   },
   methods: {
-    // 不可选日期
+    // 不可选日期
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
     },
@@ -387,7 +387,7 @@ export default {
     },
     // 返回
     handleBack () {
-      this.$router.push({ path: '/supplierManagement/supplierInfo/list', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'supplierInfoList', query: { closeLastOldTab: true } })
     },
     // 获取城市列表
     getCityList (val) {
@@ -449,6 +449,7 @@ export default {
         }
       })
     },
+    // 初始化页面
     pageInit () {
       this.getArea('province')
       this.$refs.ruleForm.resetFields()

+ 2 - 0
src/views/supplierManagement/supplierInfo/list.vue

@@ -150,12 +150,14 @@ export default {
         }
       })
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 238