lilei 1 rok pred
rodič
commit
0abf4ebc68

+ 1 - 1
public/version.json

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

+ 11 - 9
src/views/salesManagement/giftRecord/list.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+              <rangeDate id="giftRecordList-time" ref="rangeDate" :value="time" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -27,14 +27,14 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="赠送客户">
-                <custList ref="custList" @change="custChange"></custList>
+                <custList id="giftRecordList-custList" ref="custList" @change="custChange"></custList>
               </a-form-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="giftRecordList-refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="giftRecordList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
+            <a @click="advanced=!advanced" style="margin-left: 8px" id="giftRecordList-advanced">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
@@ -73,18 +73,18 @@ export default {
     return {
       tableHeight: 0,
       advanced: true, // 高级搜索 展开/关闭
-      time: [
+      time: [ // 时间查询默认值
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
       queryParam: { //  查询条件
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         productCode: '', //  产品编码
         productOrigCode: '', //  原厂编码
         salesBillNo: '', //  关联销售单号
         customerSn: undefined, //  赠送客户
-        customerNameCurrent: undefined
+        customerNameCurrent: undefined // 赠送客户名称
       },
       disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
@@ -128,12 +128,12 @@ export default {
   	}
   },
   methods: {
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    // 客户 change
+    // 选择客户 change
     custChange (obj, row) {
       if (row) {
         this.queryParam.customerSn = row && row.customerSn || undefined
@@ -158,12 +158,14 @@ export default {
       }
       this.$refs.table.refresh(true)
     },
+    // 初始化页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 195

+ 26 - 19
src/views/salesManagement/productPricing/list.vue

@@ -56,12 +56,12 @@
     </div>
     <!-- 价格 -->
     <div style="padding: 10px 0;text-align: right;">
-      <a-checkbox v-model="isCostPrice" v-if="$hasPermissions('M_ShowAllCost')"><span style="display: inline-block;">参考成本价</span></a-checkbox>
+      <a-checkbox id="productPricingList-showAllCost" v-model="isCostPrice" v-if="$hasPermissions('M_ShowAllCost')"><span style="display: inline-block;">参考成本价</span></a-checkbox>
       <!-- 特约加盟商不可见市级价 -->
-      <a-checkbox v-model="isCityPrice" v-if="$store.state.user.dealerLevel != 'SPECIAL'&&$hasPermissions('M_ShowAllCityPrice')"><span style="display: inline-block;">市级价</span></a-checkbox>
+      <a-checkbox id="productPricingList-showCityPrice" v-model="isCityPrice" v-if="$store.state.user.dealerLevel != 'SPECIAL'&&$hasPermissions('M_ShowAllCityPrice')"><span style="display: inline-block;">市级价</span></a-checkbox>
       <!-- 是否展示特约价 -->
-      <a-checkbox v-model="isSpecialPrice" v-if="$store.state.user.isShowSpecialPrice==1"><span style="display: inline-block;">特约价</span></a-checkbox>
-      <a-checkbox v-model="isTerminalPrice"><span style="display: inline-block;">终端价/自定义终端价</span></a-checkbox>
+      <a-checkbox id="productPricingList-showSpecialPrice" v-model="isSpecialPrice" v-if="$store.state.user.isShowSpecialPrice==1"><span style="display: inline-block;">特约价</span></a-checkbox>
+      <a-checkbox id="productPricingList-showTerminalPrice" v-model="isTerminalPrice"><span style="display: inline-block;">终端价/自定义终端价</span></a-checkbox>
     </div>
     <!-- 列表 -->
     <s-table
@@ -86,6 +86,7 @@
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button
+          :id="'productPricingList-record-'+record.id"
           size="small"
           type="link"
           class="button-primary"
@@ -103,8 +104,8 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
-import { dealerProductPriceList } from '@/api/dealerProduct'
 import productSalesRecordModal from './productSalesRecordModal.vue'
+import { dealerProductPriceList } from '@/api/dealerProduct'
 export default {
   name: 'DealerProductPriceList',
   components: { STable, VSelect, ProductType, ProductBrand, productSalesRecordModal },
@@ -115,17 +116,17 @@ export default {
       openModal: false,
       advanced: true, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        name: '',
-        code: '',
-        origCode: '',
-        productBrandSn: undefined,
-        productTypeSn1: '',
-        productTypeSn2: '',
-        productTypeSn3: '',
-        onlineFalg: undefined,
-        putStockFlag: true
+        name: '', // 产品名称
+        code: '', // 产品编码
+        origCode: '', // 产品原编码
+        productBrandSn: undefined, // 产品品牌
+        productTypeSn1: '', // 产品类型1
+        productTypeSn2: '', // 产品类型2
+        productTypeSn3: '', // 产品类型3
+        onlineFalg: undefined, // 上下架状态
+        putStockFlag: true // 是否包含未入库产品
       },
-      productType: [],
+      productType: [], // 产品分类默认值
       disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -147,10 +148,10 @@ export default {
           return data
         })
       },
-      isCostPrice: false,
-      isCityPrice: false,
-      isSpecialPrice: false,
-      isTerminalPrice: false
+      isCostPrice: false, // 显示成本价
+      isCityPrice: false, // 显示市价
+      isSpecialPrice: false, // 显示特价
+      isTerminalPrice: false // 显示终端价
     }
   },
   computed: {
@@ -167,13 +168,16 @@ export default {
         { title: '产品状态', dataIndex: 'onlineFalgDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ]
+      // 参考成本价
       if (this.isCostPrice) {
         arr.splice(6, 0, { title: '参考成本价', dataIndex: 'offerCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
+      // 市级价
       if (this.isCityPrice && this.$hasPermissions('M_ShowAllCityPrice')) {
         const ind = this.isCostPrice ? 7 : 6
         arr.splice(ind, 0, { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
+      // 特约价
       if (this.isSpecialPrice) {
         let ind = 0
         if (this.isCostPrice && this.isCityPrice) {
@@ -185,6 +189,7 @@ export default {
         }
         arr.splice(ind, 0, { title: '特约价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
+      // 终端价
       if (this.isTerminalPrice) {
         arr.splice(arr.length - 2, 0, { title: '终端价/自定义终端价', scopedSlots: { customRender: 'terminal' }, width: '12%', align: 'right' })
       }
@@ -217,12 +222,14 @@ export default {
       this.openModal = true
       this.$refs.salseRecord.getDetail(row)
     },
+    // 初始化页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 230

+ 26 - 20
src/views/salesManagement/productPricing/productSalesRecordModal.vue

@@ -17,10 +17,10 @@
         </div>
         <div style="display: flex;padding-bottom: 15px;align-items: center;">
           <span>选择客户:</span>
-          <div style="width: 40%;"><custList ref="custList" @change="custChange" placeholder="输入客户名称搜索"></custList></div>
+          <div style="width: 40%;"><custList id="cust-search-input" ref="custList" @change="custChange" placeholder="输入客户名称搜索"></custList></div>
           <div style="padding: 0 15px;color: #999;">
-            <a-button type="primary" @click="handelSearch(1)">查询</a-button>
-            <a-button type="default" style="margin-left: 5px" @click="reset">重置</a-button>
+            <a-button id="srecord-search-btn" type="primary" @click="handelSearch(1)">查询</a-button>
+            <a-button id="srecord-reset-btn" type="default" style="margin-left: 5px" @click="reset">重置</a-button>
           </div>
         </div>
         <!-- 表格 -->
@@ -37,6 +37,7 @@
         </a-table>
         <!-- 分页 -->
         <tablePagination
+          id="srecord-pagintion"
           ref="tablePagination"
           :total="paginationProps.total"
           :current="paginationProps.current"
@@ -63,13 +64,13 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemId: { // 当前操作id
       type: [Number, String],
       default: ''
     }
   },
   computed: {
-    modalTit () {
+    modalTit () { // 弹框标题
       return '销售记录'
     }
   },
@@ -77,10 +78,10 @@ export default {
     const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
-      queryParam: {
-        productSn: null,
-        buyerSn: undefined,
-        buyerNameCurrent: undefined
+      queryParam: { // 查询条件
+        productSn: null, // 产品sn
+        buyerSn: undefined, // 客户sn
+        buyerNameCurrent: undefined // 客户名称
       },
       // 表头
       columns: [
@@ -89,24 +90,25 @@ export default {
         { title: '销售数量', dataIndex: 'qty', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '客户名称', dataIndex: 'salesBillEntity.buyerNameCurrent', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
-      list: [],
+      list: [], // 表格数据
       loading: false,
       paginationProps: {
         total: 0, //  分页总条数
         current: 1,
         pageSize: 20
       },
-      baseData: null
+      baseData: null // 单据详情信息
     }
   },
   methods: {
+    // 重置列表
     reset () {
       this.queryParam.buyerSn = undefined
       this.queryParam.buyerNameCurrent = undefined
       this.$refs.custList.setData(undefined)
       this.getDetail(this.baseData)
     },
-    // 客户 change
+    // 选择客户 change
     custChange (obj, row) {
       if (row) {
         this.queryParam.buyerSn = row && row.customerSn || undefined
@@ -156,6 +158,16 @@ export default {
     changePage (current) {
       this.paginationProps.current = current
       this.handelSearch()
+    },
+    restTable () {
+      this.paginationProps.total = 0
+      this.paginationProps.current = 1
+      this.paginationProps.pageSize = 20
+      this.curTab = '1'
+      this.list = []
+      this.queryParam.buyerSn = undefined
+      this.queryParam.buyerNameCurrent = undefined
+      this.$refs.custList.setData(undefined)
     }
   },
   watch: {
@@ -167,14 +179,8 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.paginationProps.total = 0
-        this.paginationProps.current = 1
-        this.paginationProps.pageSize = 20
-        this.curTab = '1'
-        this.list = []
-        this.queryParam.buyerSn = undefined
-        this.queryParam.buyerNameCurrent = undefined
-        this.$refs.custList.setData(undefined)
+        // 重置列表
+        this.restTable()
       }
     }
   }

+ 11 - 6
src/views/salesManagement/salesReturn/chooseCustomModal.vue

@@ -126,6 +126,7 @@
           <a-col :span="24">
             <a-form-model-item label="备注" :labelCol="{ span: 2 }" :wrapper-col="{ span: 14 }">
               <a-textarea
+                id="chooseCustom-remarks"
                 v-model="form.remarks"
                 :maxLength="100"
                 placeholder="请输入备注(最多100个字符)"
@@ -159,6 +160,7 @@
 import { getArea } from '@/api/data'
 import { custFindById, updateByCustomerSn } from '@/api/customer'
 import { salesReturnSave } from '@/api/salesReturn'
+// 组件
 import { VSelect } from '@/components'
 import selectCust from '@/views/common/selectCust.vue'
 import CustomerManagementEdit from '@/views/customerManagement/customerInfo/edit.vue'
@@ -171,9 +173,9 @@ export default {
   data () {
     return {
       spinning: false,
-      opened: this.show,
-      title: '选择客户',
-      confirmLoading: false,
+      opened: this.show, // 弹框显示
+      title: '选择客户', // 标题
+      confirmLoading: false, // 确定保存按钮loading
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 18 }
@@ -224,13 +226,14 @@ export default {
     }
   },
   methods: {
+    // 打开新增客户
     openNewCust () {
       this.isNewCust = true
       setTimeout(() => {
         this.$refs.newCust.getBaseData()
       }, 500)
     },
-    // 新建客户
+    // 新建客户成功
     newCustFun (data) {
       console.log(data, this.isEdit)
       this.isNewCust = false
@@ -238,11 +241,12 @@ export default {
       this.$refs.custList.setData({ key: data.customerSn, label: data.customerName, row: data })
       this.custChange({ key: data.customerSn, label: data.customerName, row: data })
     },
+    // 取消新建客户弹框
     cancelNewCust () {
       this.isNewCust = false
       this.$refs.newCust.getBaseData()
     },
-    // 客户 change
+    // 选择客户 change
     custChange (obj) {
       const _this = this
       if (obj && obj.key) {
@@ -367,7 +371,7 @@ export default {
         }
       })
     },
-    // 新建或编辑销售单
+    // 新建或编辑销售退货
     salesSaveFun () {
       const _this = this
       const form = this.form
@@ -383,6 +387,7 @@ export default {
         }
       })
     },
+    // 关闭客户选择弹框
     cancel () {
       this.opened = false
       this.$refs.ruleForm.resetFields()

+ 11 - 10
src/views/salesManagement/salesReturn/detail.vue

@@ -3,9 +3,9 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="salesReturnDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }">
         <template slot="subTitle" v-if="!outBizSn">
-          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+          <a href="javascript:;" @click="handleBack" id="salesReturnDetail-back"><a-icon type="left"></a-icon> 返回列表</a>
           <span style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">退货单号:{{ detailData&&detailData.salesReturnNo||'--' }}</span>
-          <a-button type="link" size="small" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
+          <a-button type="link" size="small" class="button-default" id="salesReturnDetail-showDesc" @click="isShowBisiceInfo=!isShowBisiceInfo">
             <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/> {{ isShowBisiceInfo?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -65,10 +65,11 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { getOperationalPrecision } from '@/libs/tools.js'
-import { STable, VSelect } from '@/components'
-import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDetailPrint, salesDetailExport } from '@/api/salesReturn'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
+import { STable, VSelect } from '@/components'
+import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDetailPrint, salesDetailExport } from '@/api/salesReturn'
+
 export default {
   name: 'SalesReturnDetail',
   components: { STable, VSelect, Print },
@@ -84,8 +85,8 @@ export default {
     return {
       spinning: false,
       disabled: false,
-      countData: null,
-      isShowBisiceInfo: false,
+      countData: null, // 统计数据
+      isShowBisiceInfo: false, // 是否显示详情信息
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -116,9 +117,9 @@ export default {
               const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
               const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
               const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
-              data.list[i].productCode = productCode || '--'
-              data.list[i].productName = productName || '--'
-              data.list[i].productOrigCode = productOrigCode || '--'
+              data.list[i].productCode = productCode || '--' // 产品编码
+              data.list[i].productName = productName || '--' // 产品名称
+              data.list[i].productOrigCode = productOrigCode || '--' // 原厂编码
               // 退货数量和入库数量取值同一个字段,因表格使用统一字段会报错,因此重新定义
               data.list[i].rkqty = data.list[i].qty || 0
               // 折后退货金额小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
@@ -130,7 +131,7 @@ export default {
           return data
         })
       },
-      localDataSource: [],
+      localDataSource: [], // 列表数据
       detailData: null //  详情数据
     }
   },

+ 25 - 20
src/views/salesManagement/salesReturn/list.vue

@@ -7,17 +7,17 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="salesReturn-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="审核时间">
-                <rangeDate ref="rangeExamineDate" @change="dateExamineChange" />
+                <rangeDate id="salesReturn-aduditTime" ref="rangeExamineDate" @change="dateExamineChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <custList ref="custList" v-model="queryParam.buyerNameCurrent"></custList>
+                <custList id="salesReturn-buyerNameCurrent" ref="custList" v-model="queryParam.buyerNameCurrent"></custList>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -41,8 +41,8 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
-                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button id="salesManagementList-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button id="salesManagementList-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
                 <a @click="advanced=!advanced" style="margin-left: 8px">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -54,7 +54,7 @@
       </div>
       <!-- 操作按钮 -->
       <div class="table-operator">
-        <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
+        <a-button id="salesManagementList-add" type="primary" class="button-error" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
       </div>
       <!-- alert -->
       <a-alert type="info" style="margin-bottom: 10px;">
@@ -79,14 +79,14 @@
         bordered>
         <!-- 单号 -->
         <template slot="salesReturnNo" slot-scope="text, record">
-          <span class="table-td-link" v-if="$hasPermissions('B_salesReturnDetail')" @click="handleDetail(record)">{{ record.salesReturnNo }}</span>
+          <span :id="'salesManagementList-link-'+record.id" class="table-td-link" v-if="$hasPermissions('B_salesReturnDetail')" @click="handleDetail(record)">{{ record.salesReturnNo }}</span>
           <span v-else>{{ record.salesReturnNo }}</span>
         </template>
-        <!-- 审核 -->
+        <!-- 审核icon -->
         <template slot="audit" slot-scope="text, record">
           <stateIcon :title="record.stateDictValue" :state="record.state == 'FINISH'?'1':'2'"></stateIcon>
         </template>
-        <!-- 付款 -->
+        <!-- 付款icon -->
         <template slot="financial" slot-scope="text, record">
           <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'?'1':'2'"></stateIcon>
         </template>
@@ -99,21 +99,22 @@
               class="button-primary"
               v-if="record.state == 'WAIT_AUDIT'&&$hasPermissions('B_salesReturnAudit')"
               @click="handleEexamine(record)"
-              id="salesReturn-eexamine-btn">审核</a-button>
+              :id="'salesManagementList-audit-'+record.id"
+            >审核</a-button>
             <a-button
               size="small"
               v-if="(record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnEdit')"
               type="link"
               class="button-primary"
               @click="handleEdit(record,1)"
-              id="salesReturn-edit-btn">编辑</a-button>
+              :id="'salesManagementList-edit-'+record.id">编辑</a-button>
             <a-button
               size="small"
               v-if="(record.state == 'WAIT_AUDIT'||record.state == 'WAIT_SUBMIT') &&$hasPermissions('B_salesReturnDel')"
               type="link"
               class="button-error"
               @click="handleDel(record)"
-              id="salesReturn-del-btn">删除</a-button>
+              :id="'salesManagementList-del-'+record.id">删除</a-button>
           </div>
         </template>
       </s-table>
@@ -152,17 +153,17 @@ export default {
       advanced: true,
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
-      time: [
+      time: [ // 创建时间默认值
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
       // 查询参数
       queryParam: {
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        auditBeginDate: '',
-        auditEndDate: '',
-        buyerNameCurrent: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始创建时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束创建时间
+        auditBeginDate: '', // 开始审核时间
+        auditEndDate: '', // 结束审核时间
+        buyerNameCurrent: undefined, // 客户名称
         salesReturnNo: undefined, //  销售退货单号
         state: undefined // 业务状态
       },
@@ -207,7 +208,7 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    //  创建时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -217,7 +218,7 @@ export default {
       this.queryParam.auditBeginDate = date[0]
       this.queryParam.auditEndDate = date[1]
     },
-    // 列表统计
+    // 列表统计数据
     getQueryCount (params) {
       salesReturnCount(params).then(res => {
         this.countData = res.data || null
@@ -229,6 +230,7 @@ export default {
       if (!flag) {
         this.resetData()
       }
+      // 抓单和不抓单
       this.$router.push({ name: row.grabFlag == 1 ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { id: row.id, sn: row.salesReturnSn, buyerSn: row.buyerSn } })
     },
     // 详情
@@ -279,6 +281,7 @@ export default {
         }
       })
     },
+    // 重置操作
     resetSearchForm () {
       this.resetData()
       this.$refs.table.refresh(true)
@@ -299,6 +302,7 @@ export default {
         this.setIsHomeNav(this.$route.name, null)
       }
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -338,6 +342,7 @@ export default {
         }
       }
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 275

+ 31 - 31
src/views/salesManagement/salesReturn/queryPart.vue

@@ -1,34 +1,34 @@
 <template>
-  <div class="productInfoList-wrap">
+  <div class="salesReturn-productList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24" v-if="grabFlag == 1">
             <a-form-item label="审核时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
+              <rangeDate id="salesReturn-productList-auditTime" ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="产品编码">
-              <a-input id="productInfoList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              <a-input id="salesReturn-productList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="productInfoList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="salesReturn-productList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced && grabFlag == 1">
             <a-col :md="6" :sm="24">
               <a-form-item label="销售单号">
-                <a-input id="productInfoList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                <a-input id="salesReturn-productList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesReturn-productList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturn-productList-reset">重置</a-button>
             <a @click="advanced=!advanced" style="margin:0 15px 0 8px" v-if="grabFlag == 1">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -54,6 +54,7 @@
         <span v-if="grabFlag==1">{{ toThousands(text) }}</span>
         <div v-else>
           <a-input-number
+            :id="'salesReturn-productList-sprice-'+record.id"
             size="small"
             v-model="record.salePrice"
             :precision="2"
@@ -68,6 +69,7 @@
         <a-input-number
           size="small"
           v-model="record.returnQty"
+          :id="'salesReturn-productList-hasReturnQty-'+record.id"
           :precision="0"
           :min="0"
           :max="record.qty-record.hasReturnQty"
@@ -82,6 +84,7 @@
         <a-input-number
           size="small"
           v-model="record.celQty"
+          :id="'salesReturn-productList-celQty-'+record.id"
           :precision="0"
           :min="0"
           :max="record.returnQty"
@@ -94,6 +97,7 @@
       <template slot="warehouse" slot-scope="text, record, index">
         <a-cascader
           size="small"
+          :id="'salesReturn-productList-warehouse-'+record.id"
           @change="e => changeWarehouseCascade(e, record, index)"
           v-model="record.warehouseCascade"
           expand-trigger="hover"
@@ -110,6 +114,7 @@
         <span v-if="(grabFlag==1)&&(record.qty==record.hasReturnQty)">--</span>
         <a-button
           v-else
+          :id="'salesReturn-productList-add-'+record.id"
           size="small"
           type="link"
           class="button-primary"
@@ -128,52 +133,44 @@ import { stockList } from '@/api/stock'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 export default {
-  name: 'QueryPart',
+  name: 'SalesReturnQueryPart',
   components: { STable, VSelect, rangeDate },
   mixins: [commonMixin],
   props: {
-    // buyerSn: {
-    //   type: [Number, String],
-    //   default: ''
-    // },
-    warehouseCascadeData: {
+    warehouseCascadeData: { // 仓库信息
       type: Array,
       default: function () {
         return []
       }
     },
-    newLoading: Boolean,
-    grabFlag: [Number, String]
-    // priceType: [Number, String]
+    newLoading: Boolean, // loading
+    grabFlag: [Number, String] // 是否抓单
   },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
         salesBillNo: '', //  销售单号
         productName: '', // 产品名称
         productCode: '' //  产品编码
       },
-      buyerSn: '',
-      priceType: '',
+      buyerSn: '', // 客户sn
+      priceType: '', // 价格类型
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [],
+      columns: [], // 列
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // 抓单时
-        // if (this.grabFlag == 1) {
-        //   this.queryParam.buyerSn = this.buyerSn
-        // }
         this.queryParam.buyerSn = this.buyerSn
+        // 抓单和不抓单列表查询接口不一样
         const fun = [stockList, salesReturnProductList]
+        // 不抓单时,传价格类型
         if (this.grabFlag == 0) {
           this.queryParam.salePriceType = this.priceType
         }
         return fun[this.grabFlag](Object.assign(parameter, this.queryParam)).then(res => {
-          console.log(res)
           let data
           if (res.status == 200) {
             data = res.data
@@ -182,7 +179,6 @@ export default {
               data.list[i].no = no + i + 1
               // 不抓单
               if (this.grabFlag == 0) {
-                console.log(this.warehouseCascadeData, data)
                 data.list[i].putCost = data.list[i].lastStockCost
                 const warehouse = this.warehouseCascadeData.find(item => item.sysFlag == 1 && item.wasteFlag == 0)
                 if (warehouse) {
@@ -206,6 +202,7 @@ export default {
                 }
               }
             }
+            // 最终列表数据
             this.listData = data.list || []
             this.disabled = false
           }
@@ -216,7 +213,6 @@ export default {
     }
   },
   mounted () {
-    const _this = this
     // 抓单
     if (this.grabFlag == 1) {
       this.columns = [
@@ -235,6 +231,7 @@ export default {
         { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }]
     } else {
+      // 不抓单
       this.columns = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
@@ -249,7 +246,7 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -268,6 +265,7 @@ export default {
     changeWarehouseCascade (val, opt, ind) {
       console.log(val, opt, ind)
       const loadData = this.listData[ind]
+      // 是否当前仓库无仓位
       if (val.length < 2) {
         this.$message.warning('当前仓库无仓位,请选择其他仓库')
         const warehouseSnBackups = loadData.warehouseSnBackups || undefined
@@ -280,6 +278,7 @@ export default {
           loadData.warehouseCascade = undefined
         }
       } else {
+        // 有仓库仓位
         loadData.warehouseSn = val[0] ? val[0] : ''
         loadData.warehouseLocationSn = val[1] ? val[1] : ''
         loadData.warehouseSnBackups = val[0] ? val[0] : ''
@@ -296,16 +295,17 @@ export default {
       this.queryParam.productCode = ''
       this.$refs.table.refresh(true)
     },
+    // 初始化,客户sn、价格类型
     pageInit (buyerSn, priceType) {
-      console.log(buyerSn, priceType)
       this.buyerSn = buyerSn
       this.priceType = priceType
       this.refreshData()
     },
+    // 刷新列表
     refreshData () {
       this.$refs.table.refresh()
     },
-    // 选择配件
+    // 添加配件产品
     handleAdd (row) {
       this.$emit('add', row, 'new')
     }

+ 40 - 32
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -6,10 +6,11 @@
         <template slot="subTitle">
           <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">退货单号:{{ ordeDetail&&ordeDetail.salesReturnNo||'--' }}</span>
-          <a-button type="link" size="small" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
+          <a-button id="salesReturnEdit-showDesc-btn" type="link" size="small" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
             <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/> {{ isShowBisiceInfo?'隐藏':'查看' }}信息
           </a-button>
           <a-button
+            id="salesReturnEdit-editInfo-btn"
             type="link"
             size="small"
             @click="handleEditCustom"
@@ -64,7 +65,7 @@
               <div>
                 折扣金额:
                 <a-input-number id="discount" v-model="ordeDetail.discountAmount" :min="0" :precision="2" :max="999999"/>
-                <a-button type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
+                <a-button id="salesReturnEdit-discount-btn" type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
               </div>
               <div>
                 折扣:<strong>{{ ordeDetail&&(ordeDetail.discountRate || ordeDetail.discountRate==0) ? ordeDetail.discountRate+'%' : '--' }}</strong>;
@@ -81,12 +82,12 @@
                 <a-row :gutter="15">
                   <a-col :md="8" :sm="24">
                     <a-form-model-item label="产品编码">
-                      <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
+                      <a-input id="salesReturnEdit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
                     </a-form-model-item>
                   </a-col>
                   <a-col :md="8" :sm="24">
                     <a-form-model-item label="产品名称">
-                      <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
+                      <a-input id="salesReturnEdit-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
                     </a-form-model-item>
                   </a-col>
                   <a-col :md="8" :sm="24">
@@ -115,7 +116,7 @@
                   :disabled="chooseLoadData.length==0"
                   :loading="delLoading"
                   style="margin-left: 10px"
-                  id="salesReturn-del-all">清空列表</a-button>
+                  id="salesReturn-delAll">清空列表</a-button>
               </div>
             </a-col>
           </a-row>
@@ -135,7 +136,7 @@
           <!-- 本次退货数量 -->
           <template slot="qty" slot-scope="text, record">
             <a-input-number
-              id="salesReturn-qty"
+              :id="'salesReturn-qty-'+record.id"
               size="small"
               v-model="record.qty"
               :precision="0"
@@ -148,7 +149,7 @@
           <!-- 废品数量 -->
           <template slot="celQty" slot-scope="text, record">
             <a-input-number
-              id="salesReturn-celQty"
+              :id="'salesReturn-celQty-'+record.id"
               size="small"
               v-model="record.celQty"
               :precision="0"
@@ -161,7 +162,7 @@
           <!-- 价格 -->
           <template slot="price" slot-scope="text, record">
             <a-input-number
-              id="salesReturn-price"
+              :id="'salesReturn-price-'+record.id"
               size="small"
               v-model="record.price"
               :precision="2"
@@ -184,7 +185,7 @@
               expand-trigger="hover"
               :options="warehouseCascadeData"
               :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-              id="bulkWarehousingOrderEdit-warehouseCascade"
+              :id="'salesReturn-warehouseCascade-'+record.id"
               placeholder="请选择仓库仓位"
               style="width: 100%;" />
           </template>
@@ -196,12 +197,12 @@
               :loading="delLoading"
               class="button-error"
               @click="handleDel(record)"
-              id="salesReturn-Del">删除</a-button>
+              :id="'salesReturn-del-'+record.id"
+            >删除</a-button>
           </template>
         </s-table>
       </a-card>
     </a-spin>
-    <!-- <div class="affix-cont"></div> -->
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="editCustomModal" :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
   </div>
@@ -210,12 +211,14 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
+import Print from '@/views/common/print.vue'
+import { hdPrint } from '@/libs/JGPrint'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
+// 接口
 import { warehouseCascadeList } from '@/api/warehouse'
 import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDiscount, salesReturnDelAll, salesReturnDetailDel, salesReturnSaveProduct, salesReturnSubmit, salesReturnDetailPrint, salesDetailExport } from '@/api/salesReturn'
-import Print from '@/views/common/print.vue'
-import { hdPrint } from '@/libs/JGPrint'
+
 export default {
   name: 'SalesReturnEdit',
   components: {
@@ -230,23 +233,23 @@ export default {
     const _this = this
     return {
       spinning: false,
-      orderId: null,
-      orderSn: null,
-      buyerSn: null,
       disabled: false,
-      openModal: false,
+      orderId: null, // 单据id
+      orderSn: null, // 单据sn
+      buyerSn: null, // 客户sn
+      openModal: false, // 选择客户弹框
       isInster: false, // 是否正在添加产品
-      ordeDetail: { discountAmount: 0 },
-      delLoading: false,
+      ordeDetail: { discountAmount: 0 }, // 单据详情信息
+      delLoading: false, // 添加删除按钮loading
       warehouseCascadeData: [], //  仓库仓位
       // 已选产品
       dataSource: [],
       productForm: {
-        productCode: '',
-        productName: '',
-        orderBy: 'sales_return_bill_detail.CREATE_DATE desc'
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        orderBy: 'sales_return_bill_detail.CREATE_DATE desc' // 排序
       },
-      countData: null,
+      countData: null, // 统计信息
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
@@ -262,7 +265,7 @@ export default {
         { title: '折后金额小计', dataIndex: 'discountedAmount', align: 'right', width: '8%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
-      chooseLoadData: [],
+      chooseLoadData: [], // 已选列表原始数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -279,6 +282,7 @@ export default {
               data.list[i].qtyBackups = data.list[i].qty
               data.list[i].celQtyBackups = data.list[i].celQty
               data.list[i].priceBackups = data.list[i].price
+              // 仓库仓位
               const warehouseSn = data.list[i].warehouseSn || undefined
               const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
               if (warehouseSn || warehouseLocationSn) {
@@ -296,24 +300,25 @@ export default {
         })
       },
       printerType: 'NEEDLE', //  打印机类型
-      isShowBisiceInfo: false
+      isShowBisiceInfo: false // 是否显示详情信息
     }
   },
   methods: {
-    //  返回
+    //  返回列表
     handleBack () {
-      this.$router.push({ path: '/salesManagement/salesReturn/list' })
+      this.$router.push({ name: 'salesReturnList' })
     },
     // 选择客户成功
     chooseCustomOk (data) {
       this.openModal = false
       this.getOrderDetail()
     },
+    // 编辑客户
     handleEditCustom () {
       this.openModal = true
       this.$refs.editCustomModal.editCust(this.ordeDetail)
     },
-    // 已选产品  blur
+    // 已选产品,修改数量、价格、废品数量
     onCellBlur (val, record, type) {
       let valBackups
       if (type == 'qty') {
@@ -325,6 +330,7 @@ export default {
       }
       //  光标移出,值发生改变再调用编辑接口
       if (val && val != valBackups) {
+        // 废品数量不可大于本次退货数量
         if (Number(record.celQty) > Number(record.qty)) {
           this.$message.info('废品数量不可大于本次退货数量')
           this.reductionVal(record, type, valBackups)
@@ -335,6 +341,7 @@ export default {
         this.reductionVal(record, type, valBackups)
       }
     },
+    // 恢复原值
     reductionVal (record, type, valBackups) {
       if (type == 'qty') {
         record.qty = valBackups
@@ -365,6 +372,7 @@ export default {
     // 修改仓库仓位
     changeWarehouseCascade (val, opt, ind) {
       let loadData = this.chooseLoadData[ind]
+      // 仓库无仓位
       if (val.length < 2) {
         this.$message.warning('当前仓库无仓位,请选择其他仓库')
         const warehouseSnBackups = loadData.warehouseSnBackups || undefined
@@ -405,6 +413,7 @@ export default {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
         if (!flag) {
+          // 查询产品列表
           this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
         }
       })
@@ -418,6 +427,7 @@ export default {
         id: this.ordeDetail.id
       }).then(res => {
         if (res.status == 200) {
+          // 获取详情,并刷新已选产品列表
           this.getOrderDetail(true)
           this.$refs.table.refresh(true)
           this.spinning = false
@@ -479,7 +489,6 @@ export default {
     },
     // 添加或修改产品
     saveProduct (row, type) {
-      console.log(row)
       // 防止多次添加产品
       if (this.isInster) {
         return
@@ -506,10 +515,8 @@ export default {
         params.id = row.id
         params.qty = row.qty
       } else {
+        // 新增
         params.salesQty = row.qty
-        // 默认仓库
-        // params.warehouseLocationSn = '100000000165'
-        // params.warehouseSn = '100000000156'
       }
       this.spinning = true
       salesReturnSaveProduct(params).then(res => {
@@ -548,6 +555,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 页面初始化
     pageInit () {
       this.orderId = this.$route.params.id
       this.orderSn = this.$route.params.sn

+ 28 - 26
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -6,11 +6,12 @@
         <template slot="subTitle">
           <a id="salesReturnGrabEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">退货单号:{{ ordeDetail&&ordeDetail.salesReturnNo||'--' }}</span>
-          <a-button type="link" size="small" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
+          <a-button id="salesReturnGrabEdit-showDesc-btn" type="link" size="small" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
             <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/> {{ isShowBisiceInfo?'隐藏':'查看' }}信息
           </a-button>
           <a-button
             type="link"
+            id="salesReturnGrabEdit-editDesc-btn"
             size="small"
             @click="handleEditCustom"
             class="button-info"
@@ -65,7 +66,7 @@
                   :min="0"
                   :precision="2"
                   :max="999999"/>
-                <a-button size="small" type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
+                <a-button id="salesReturnGrabEdit-discount-btn" size="small" type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
               </div>
               <div>
                 折扣:<strong>{{ ordeDetail&&(ordeDetail.discountRate || ordeDetail.discountRate==0) ? ordeDetail.discountRate+'%' : '--' }}</strong>;
@@ -82,12 +83,12 @@
                 <a-row :gutter="15">
                   <a-col :md="8" :sm="24">
                     <a-form-model-item label="产品编码">
-                      <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
+                      <a-input id="salesReturnGrabEdit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
                     </a-form-model-item>
                   </a-col>
                   <a-col :md="8" :sm="24">
                     <a-form-model-item label="产品名称">
-                      <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
+                      <a-input id="salesReturnGrabEdit-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
                     </a-form-model-item>
                   </a-col>
                   <a-col :md="8" :sm="24">
@@ -101,14 +102,13 @@
             </a-col>
             <a-col :span="6">
               <div style="float:right;overflow: hidden;">
-                <!-- <a-button id="salesReturn-dru">导入明细</a-button> -->
                 <a-button
                   style="padding: 0 25px;"
                   type="primary"
                   :disabled="spinning"
                   class="button-primary"
                   @click="handleSubmit()"
-                  id="salesReturn-handleSubmit">提交</a-button>
+                  id="salesReturnGrabEdit-handleSubmit">提交</a-button>
                 <a-button
                   type="primary"
                   ghost
@@ -116,7 +116,7 @@
                   @click="salesReturnDelAll"
                   :loading="delLoading"
                   style="margin-left: 10px"
-                  id="salesReturn-del-all">清空列表</a-button>
+                  id="salesReturnGrabEdit-del-all">清空列表</a-button>
               </div>
             </a-col>
           </a-row>
@@ -136,7 +136,7 @@
           <!-- 本次退货数量 -->
           <template slot="qty" slot-scope="text, record">
             <a-input-number
-              id="salesReturns-qty"
+              :id="'salesReturnGrabEdit-qty-'+record.id"
               size="small"
               v-model="record.qty"
               :precision="0"
@@ -149,9 +149,9 @@
           <!-- 废品数量 -->
           <template slot="celQty" slot-scope="text, record">
             <a-input-number
-              id="salesReturns-celQty"
               size="small"
               v-model="record.celQty"
+              :id="'salesReturnGrabEdit-celQty-'+record.id"
               :precision="0"
               :min="0"
               :max="999999"
@@ -171,7 +171,7 @@
               :options="warehouseCascadeData"
               :allowClear="false"
               :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-              id="bulkWarehousingOrderEdit-warehouseCascade"
+              :id="'salesReturnGrabEdit-warehouseCascade-'+record.id"
               placeholder="请选择仓库仓位"
               style="width: 100%;" />
           </template>
@@ -183,12 +183,11 @@
               :loading="delLoading"
               class="button-error"
               @click="handleDel(record)"
-              id="salesReturn-Del">删除</a-button>
+              :id="'salesReturnGrabEdit-del-'+record.id">删除</a-button>
           </template>
         </s-table>
       </a-card>
     </a-spin>
-    <!-- <div class="affix-cont"></div> -->
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="editCustomModal" :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
   </div>
@@ -217,21 +216,21 @@ export default {
     const _this = this
     return {
       spinning: false,
-      orderId: null,
-      orderSn: null,
-      buyerSn: null,
       disabled: false,
-      openModal: false,
+      orderId: null, // 单据id
+      orderSn: null, // 单据sn
+      buyerSn: null, // 客户sn
+      openModal: false, // 选择客户弹框
       isInster: false, // 是否正在添加产品
-      ordeDetail: { discountAmount: 0 },
-      delLoading: false,
+      ordeDetail: { discountAmount: 0 }, // 详情信息
+      delLoading: false, // 按钮loading
       warehouseCascadeData: [], //  仓库仓位
       // 已选产品
       dataSource: [],
       productForm: {
-        productCode: '',
-        productName: '',
-        orderBy: 'sales_return_bill_detail.CREATE_DATE desc'
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        orderBy: 'sales_return_bill_detail.CREATE_DATE desc' // 排序
       },
       countData: null,
       // 表头
@@ -251,7 +250,7 @@ export default {
         { title: '折后金额小计', dataIndex: 'discountedAmount', align: 'right', width: '7%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '5%', align: 'center' }
       ],
-      chooseLoadData: [],
+      chooseLoadData: [], // 已添加数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -267,6 +266,7 @@ export default {
               data.list[i].no = no + i + 1
               data.list[i].qtyBackups = data.list[i].qty
               data.list[i].celQtyBackups = data.list[i].celQty
+              // 仓库仓位默认值
               const warehouseSn = data.list[i].warehouseSn || undefined
               const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
               if (warehouseSn || warehouseLocationSn) {
@@ -284,24 +284,25 @@ export default {
         })
       },
       printerType: 'NEEDLE', //  打印机类型
-      isShowBisiceInfo: false
+      isShowBisiceInfo: false // 是否显示详情信息
     }
   },
   methods: {
     //  返回
     handleBack () {
-      this.$router.push({ path: '/salesManagement/salesReturn/list' })
+      this.$router.push({ name: 'salesReturnList' })
     },
     // 选择客户成功
     chooseCustomOk (data) {
       this.openModal = false
       this.getOrderDetail()
     },
+    // 打开编辑客户弹框
     handleEditCustom () {
       this.openModal = true
       this.$refs.editCustomModal.editCust(this.ordeDetail)
     },
-    // 已选产品  blur
+    // 已选产品,数量,价格、废品数量修改
     onCellBlur (val, record, type) {
       let valBackups
       if (type == 'qty') {
@@ -321,6 +322,7 @@ export default {
         this.reductionVal(record, type, valBackups)
       }
     },
+    // 恢复默认值
     reductionVal (record, type, valBackups) {
       if (type == 'qty') {
         record.qty = valBackups
@@ -466,7 +468,6 @@ export default {
     },
     // 添加或修改产品
     saveProduct (row, type) {
-      console.log(row)
       // 防止多次添加产品
       if (this.isInster) {
         return
@@ -531,6 +532,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 初始化页面
     pageInit () {
       this.orderId = this.$route.params.id
       this.orderSn = this.$route.params.sn

+ 18 - 16
src/views/salesManagement/salesman/editModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="supplierInfoEdit-modal"
+    class="salesmanEdit-modal"
     :footer="null"
     :maskClosable="false"
     :title="modalTitle"
@@ -12,7 +12,7 @@
       <!-- 表单 -->
       <div v-if="!isView">
         <a-form-model
-          id="supplierInfoEdit-form"
+          id="salesmanEdit-form"
           ref="ruleForm"
           :model="form"
           :rules="rules"
@@ -21,7 +21,7 @@
         >
           <a-form-model-item label="姓名" prop="name">
             <a-input
-              id="supplierInfoEdit-name"
+              id="salesmanEdit-name"
               :maxLength="10"
               v-model.trim="form.name"
               @change="filterEmpty"
@@ -30,7 +30,7 @@
           </a-form-model-item>
           <a-form-model-item label="身份证号">
             <a-input
-              id="supplierInfoEdit-idCard"
+              id="salesmanEdit-idCard"
               :maxLength="18"
               v-model.trim="form.idCard"
               placeholder="请输入身份证号"
@@ -38,7 +38,7 @@
           </a-form-model-item>
           <a-form-model-item label="手机号码" prop="mobile">
             <a-input
-              id="supplierInfoEdit-mobile"
+              id="salesmanEdit-mobile"
               :maxLength="11"
               v-model.trim="form.mobile"
               placeholder="请输入手机号码(最多11个字符)"
@@ -47,6 +47,7 @@
           <a-form-model-item label="入职日期" prop="entryDate">
             <a-date-picker
               v-model="form.entryDate"
+              id="salesmanEdit-date"
               type="date"
               :disabled-date="disabledDate"
               :defaultValue="null"
@@ -58,7 +59,7 @@
             <a-radio-group
               name="radioGroup"
               v-model="form.sex"
-              id="supplierInfoEdit-enabledFlag" >
+              id="salesmanEdit-sex" >
               <a-radio :value="1">男</a-radio>
               <a-radio :value="0">女</a-radio>
             </a-radio-group>
@@ -67,15 +68,15 @@
             <a-radio-group
               name="radioGroup"
               v-model="form.enableFlag"
-              id="enableFlag" >
+              id="salesmanEdit-enableFlag" >
               <a-radio :value="1">启用</a-radio>
               <a-radio :value="0">禁用</a-radio>
             </a-radio-group>
           </a-form-model-item>
         </a-form-model>
         <div class="btn-cont">
-          <a-button type="primary" size="large" id="supplierInfoEdit-btn-submit" @click="handleSubmit">保存</a-button>
-          <a-button id="supplierInfoEdit-btn-back" size="large" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+          <a-button type="primary" size="large" id="salesmanEdit-btn-submit" @click="handleSubmit">保存</a-button>
+          <a-button id="salesmanEdit-btn-back" size="large" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
         </div>
       </div>
       <!-- 详情 -->
@@ -103,11 +104,11 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemId: { // 记录id
       type: [Number, String],
       default: ''
     },
-    modalTitle: {
+    modalTitle: { // 弹框标题
       type: String,
       default: ''
     },
@@ -154,15 +155,16 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    // 不可选日期
+    // 不可选日期范围
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
+    // 姓名过滤特殊字符
     filterEmpty () {
       let str = this.form.supplierName
       str = str.replace(/\ +/g, '')
@@ -201,7 +203,6 @@ export default {
             }
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -230,13 +231,14 @@ export default {
         this.$emit('close')
       }
     },
+    // 是否编辑
     itemId (newValue, oldValue) {
       if (this.isShow && newValue) {
         this.getDetail()
       }
     },
+    // 标题
     modalTitle (newValue, oldValue) {
-      console.log(newValue)
       if (newValue) {
         if (newValue == '编辑' || newValue == '新增') {
           this.isView = false
@@ -251,7 +253,7 @@ export default {
 </script>
 
 <style lang="less">
-  .supplierInfoEdit-modal{
+  .salesmanEdit-modal{
     .ant-modal-body {
       padding: 40px 40px 24px;
     }

+ 13 - 35
src/views/salesManagement/salesman/list.vue

@@ -4,6 +4,11 @@
     <div ref="tableSearch" class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="创建时间">
+              <rangeDate id="salesmanList-time" ref="rangeDate" @change="dateChange" />
+            </a-form-item>
+          </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="姓名">
               <a-input id="salesmanList-supplierName" v-model.trim="queryParam.name" allowClear placeholder="请输入姓名"/>
@@ -14,11 +19,6 @@
               <v-select code="ENABLE_FLAG" id="salesmanList-enableFlag" v-model="queryParam.enableFlag" allowClear placeholder="请选择启用状态"></v-select>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="创建时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesmanList-refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesmanList-reset">重置</a-button>
@@ -55,14 +55,14 @@
           class="button-primary"
           @click="handleEdit(record,1)"
           v-if="$hasPermissions('B_salesman_edit')"
-          id="salesmanList-edit-btn">编辑</a-button>
+          :id="'salesmanList-edit-'+record.id">编辑</a-button>
         <a-button
           size="small"
           type="link"
           v-if="$hasPermissions('B_salesman_detail')"
           class="button-success"
           @click="handleEdit(record,2)"
-          id="salesmanList-edit-btn">详情</a-button>
+          :id="'salesmanList-detail-'+record.id">详情</a-button>
         <span v-else>--</span>
       </template>
     </s-table>
@@ -86,12 +86,12 @@ export default {
       advanced: true, // 高级搜索 展开/关闭
       modalTitle: '', // 弹窗title
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
         name: '', //  姓名
         enableFlag: undefined //  状态
       },
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -126,7 +126,7 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -156,42 +156,20 @@ export default {
       }
       this.openModal = true
     },
-    // //  通过
-    // handleSend (row) {
-    //   const _this = this
-    //   this.$confirm({
-    //     title: '提示',
-    //     content: '审核通过后该类型名称不能更改,确定审核通过该类型名称?',
-    //     centered: true,
-    //     closable: true,
-    //     onOk () {
-    //       _this.spinning = true
-    //       employeeAudit({
-    //         salesBillSn: row.id
-    //       }).then(res => {
-    //         if (res.status == 200) {
-    //           _this.$message.success(res.message)
-    //           _this.$refs.table.refresh()
-    //           _this.spinning = false
-    //         } else {
-    //           _this.spinning = false
-    //         }
-    //       })
-    //     }
-    //   })
-    // },
     // 关闭弹框
     closeModal () {
       this.itemId = ''
       this.openModal = false
       this.$refs.table.refresh(true)
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 245