Browse Source

完善id和注释

lilei 1 year ago
parent
commit
eeaeb8d533

+ 1 - 1
public/version.json

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

+ 3 - 2
src/views/salesManagement/salesQueryNew/carInfoModal.vue

@@ -44,7 +44,7 @@
 </template>
 
 <script>
-import defImg from '@/assets/def_img@2x.png'
+import defImg from '@/assets/def_img@2x.png' // 默认图片
 export default {
   name: 'CarInfoDetailModal',
   props: {
@@ -52,7 +52,7 @@ export default {
       type: Boolean,
       default: false
     },
-    infoData: {
+    infoData: { // 基本信息
       type: Object,
       default: () => {
         return {}
@@ -66,6 +66,7 @@ export default {
     }
   },
   methods: {
+    // 预览图片
     inited (viewer) {
       if (viewer) {
         const imageUrl = []

+ 17 - 11
src/views/salesManagement/salesQueryNew/chooseCustomModal.vue

@@ -27,7 +27,7 @@
             </a-col>
             <a-col :span="8" v-if="$hasPermissions('B_customer_customerInfo_add')">
               <a-form-model-item :labelCol="{ span: 0 }" :wrapperCol="{ span: 24 }">
-                <a-button type="primary" class="button-primary" @click="openNewCust" icon="plus">新增</a-button>
+                <a-button id="chooseCustom-newCust" type="primary" class="button-primary" @click="openNewCust" icon="plus">新增</a-button>
                 (点击新增按钮新增客户)
               </a-form-model-item>
             </a-col>
@@ -130,6 +130,7 @@
             <a-col :span="8">
               <a-form-model-item label="收款方式" prop="settleStyleSn">
                 <settleStyle
+                  id="chooseCustom-settleStyleSn"
                   v-model="form.settleStyleSn"
                   placeholder="请选择收款方式">
                 </settleStyle>
@@ -194,10 +195,12 @@
 </template>
 
 <script>
+// 接口
 import { getArea } from '@/api/data'
 import { custFindById, updateByCustomerSn } from '@/api/customer'
 import { salesSave } from '@/api/sales'
 import { employeeAllList } from '@/api/salesman'
+// 组件
 import settleStyle from '@/views/common/settleStyle'
 import { VSelect } from '@/components'
 import selectCust from '@/views/common/selectCust.vue'
@@ -206,8 +209,8 @@ export default {
   name: 'ChooseCustomModal',
   components: { VSelect, CustomerManagementEdit, selectCust, settleStyle },
   props: {
-    show: [Boolean],
-    distributionFlag: {
+    show: [Boolean], // 是否显示弹框
+    distributionFlag: { // 是否铺货
       type: [String, Number],
       default: '0'
     }
@@ -215,9 +218,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 }
@@ -228,7 +231,7 @@ export default {
         buyerName: '', // 客户名称
         buyerSn: undefined, // 客户sn
         consigneeTel: '', //  联系电话
-        consigneeMobile: '',
+        consigneeMobile: '', // 联系电话1
         consigneeName: '', //  联系人
         shippingAddressProvinceSn: undefined, //  省
         shippingAddressProvinceName: '',
@@ -243,11 +246,12 @@ export default {
         priceType: undefined, //  价格类型
         settleStyleSn: undefined, //  收款方式
         salesManSn: undefined, //  业务员
-        salesManName: '',
+        salesManName: '', // 业务员
         distributionFlag: undefined, // 铺货出库
-        salesTragetType: 'CUSTOMER',
+        salesTragetType: 'CUSTOMER', // 单据目标类型
         remarks: '' //  备注
       },
+      // 规则校验
       rules: {
         buyerSn: [
           { required: true, message: '请选择客户', trigger: ['change', 'blur'] }
@@ -288,10 +292,12 @@ export default {
     }
   },
   methods: {
+    // 选择价格类型
     changePriceType (v) {
       this.form.priceType = v
       this.$refs.ruleForm.clearValidate('priceType')
     },
+    // 新建客户
     openNewCust () {
       this.isNewCust = true
       setTimeout(() => {
@@ -306,7 +312,7 @@ export default {
       this.$refs.custList.setData({ key: data.customerSn, label: data.customerName, row: data })
       this.custChange({ key: data.customerSn, label: data.customerName, row: data })
     },
-    // 业务员
+    // 业务员选择
     salesManChange (employeeSn) {
       if (employeeSn) {
         this.form.salesManName = this.userList.find(item => item.employeeSn == employeeSn).name
@@ -314,7 +320,7 @@ export default {
         this.form.salesManName = ''
       }
     },
-    // 客户 change
+    // 客户选择
     custChange (obj) {
       const _this = this
       if (obj && obj.key) {

+ 7 - 2
src/views/salesManagement/salesQueryNew/chooseImportModal.vue

@@ -87,7 +87,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: Object,
       default: () => {
         return {}
@@ -98,6 +98,7 @@ export default {
     const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 正确数据
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -109,6 +110,7 @@ export default {
         { title: '单位', dataIndex: 'importProductUnit', align: 'center', width: '15%', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
+      // 错误项
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -123,15 +125,18 @@ export default {
     }
   },
   methods: {
+    // 获取数据
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
       this.loadData = paramsData.rightList || []
       this.unLoadData = paramsData.errorList || []
+      // 正确的
       this.loadData.map((item, index) => {
         item.no = index + 1
         item.salesBillNo = paramsData.salesBillNo
         item.salesBillSn = paramsData.salesBillSn
       })
+      // 错误的
       this.unLoadData.map((item, index) => {
         item.no = index + 1
         item.salesBillNo = paramsData.salesBillNo
@@ -152,7 +157,7 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.paramsData.errorList.length < 1) {

+ 40 - 34
src/views/salesManagement/salesQueryNew/chooseProductModal.vue

@@ -71,7 +71,7 @@
             </a-col>
             <a-col flex="200px">
               <a-form-item label="是否有库存">
-                <a-select @change="handleHasQty" allowClear :value="queryParam.existStockFlag" placeholder="请选择是否">
+                <a-select id="productInfoList-existStockFlag" @change="handleHasQty" allowClear :value="queryParam.existStockFlag" placeholder="请选择是否">
                   <a-select-option value="1">
                   </a-select-option>
@@ -87,14 +87,14 @@
             </a-col>
           </a-row>
         </a-form-model>
-
+        <!-- 查看更多 -->
         <div v-if="hasVaild&&showTable" class="vinInfo-box">
           <div>
             <div class="vinInfo-error" v-if="vinInfoData&&!vinInfoData.vinInfo">
               <a-icon type="exclamation-circle" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!
             </div>
-            <div v-if="vinInfoData&&vinInfoData.vinInfo" @click="openCarInfoModal=true">
-              <div style="display: flex;justify-content: space-between;align-items: center;" @click="openCarInfoModal=true">
+            <div v-if="vinInfoData&&vinInfoData.vinInfo" id="productInfoList-carinfo" @click="openCarInfoModal=true">
+              <div style="display: flex;justify-content: space-between;align-items: center;" id="productInfoList-carinfoMoadl" @click="openCarInfoModal=true">
                 <div>
                   <img :src="vinInfoData.vinInfo && vinInfoData.vinInfo.icon?(vinInfoData.vinInfo.icon+'?x-oss-process=image/resize,h_30,m_lfit'):defImg" width="30" height="30" class="imageUrl" style="border-radius: 50%;vertical-align: middle;margin-right: 3px;" />
                   <span style="vertical-align: middle;">{{ vinInfoData.vinInfo.text }}</span>
@@ -107,10 +107,10 @@
           </div>
           <div>
             <a-dropdown v-model="showCell">
-              <a class="ant-dropdown-link" @click="e => e.preventDefault()">
+              <a class="ant-dropdown-link" id="productInfoList-showCell" @click="e => e.preventDefault()">
                 <a-icon type="setting" /> 显示
               </a>
-              <a-menu slot="overlay">
+              <a-menu slot="overlay" id="productInfoList-showMenu">
                 <a-menu-item v-if="$hasPermissions('M_ShowAllCost')" >
                   <a-checkbox v-model="cost" id="salesQuery-cost">成本价</a-checkbox>
                 </a-menu-item>
@@ -155,6 +155,7 @@
         <template slot="salePrice" slot-scope="text, record">
           <div style="display: flex;align-items: center;" @dblclick.stop>
             <a-input-number
+              :id="'productInfoList-price-'+record.id"
               size="small"
               v-model="record.price"
               :precision="2"
@@ -170,6 +171,7 @@
         <template slot="nums" slot-scope="text, record">
           <div @dblclick.stop>
             <a-input-number
+              :id="'productInfoList-mums-'+record.id"
               size="small"
               v-model="record.salesNums"
               :precision="0"
@@ -188,13 +190,13 @@
             class="button-primary"
             @click="handleAdd(record)"
             v-else
-            id="productInfoList-edit-btn">添加</a-button>
+            :id="'productInfoList-add-'+record.id">添加</a-button>
           <a-button
             size="small"
             type="link"
             class="button-primary"
             @click="handleDetail(record)"
-            id="productInfoList-detail-btn"
+            :id="'productInfoList-record-'+record.id"
             style="margin-left: 5px;">销售记录</a-button>
         </template>
       </s-table>
@@ -220,6 +222,7 @@ import { Empty } from 'ant-design-vue'
 import { commonMixin } from '@/utils/mixin'
 import { querySumByProductLocation } from '@/api/stock'
 import { warehouseAllList } from '@/api/warehouse'
+// 组件
 import carInfoModal from './carInfoModal.vue'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
@@ -230,22 +233,22 @@ export default {
   mixins: [commonMixin],
   components: { STable, VSelect, Upload, carInfoModal, ProductType, ProductBrand },
   props: {
-    showModal: {
+    showModal: { // 显示弹框
       type: Boolean,
       default: false
     },
-    width: {
+    width: { // 弹框宽度
       type: [String, Number],
       default: '80%'
     },
-    zIndex: {
+    zIndex: { // 弹框层级
       type: Number,
       default: 100
     },
-    newLoading: {
+    newLoading: { // 添加按钮loading
       type: Boolean
     },
-    checkedList: {
+    checkedList: { // 已选产品列表
       type: Array,
       default: () => []
     }
@@ -254,6 +257,7 @@ export default {
     showModal (newValue, oldValue) {
       this.visible = newValue
       if (newValue) {
+        // 开始查询列表
         this.$refs.searchProductCode.focus()
         this.setTableH()
       }
@@ -264,43 +268,43 @@ export default {
   },
   data () {
     return {
-      showCell: false,
-      spinning: false,
-      showTable: false,
-      visible: this.showModal,
-      title: '添加产品',
-      tableHeight: 0,
-      tableWidth: 1760,
+      showCell: false, // 显示下拉
+      spinning: false, // loading动画
+      showTable: false, // 是否显示表格
+      visible: this.showModal, // 是否显示弹框
+      title: '添加产品', // 弹框标题
+      tableHeight: 0, // 表格高度
+      tableWidth: 1760, // 表格宽度
       simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
       advanced: false, // 高级搜索 展开/关闭
-      vinLoading: false,
-      productType: [],
-      defImg,
+      vinLoading: false, // vin识别loading
+      productType: [], // 产品类型
+      defImg, // 默认图片
       queryParam: { //  查询条件
-        customerSn: '',
-        salesBillSn: '',
-        salePriceType: '',
+        customerSn: '', // 客户sn
+        salesBillSn: '', // 销售单sn
+        salePriceType: '', // 价格类型
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productOrigCode: '', //  原厂编码
-        vinCode: '',
+        vinCode: '', // vin 码
         productCodeList: undefined, //  车架号
         brandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         warehouseSn: undefined, //  仓库、
-        enableFlag: '1',
-        existStockFlag: undefined
+        enableFlag: '1', // 启用禁用
+        existStockFlag: undefined // 是否有库存
       },
-      priceType: '',
-      buyerSn: '',
+      priceType: '', // 价格类型值
+      buyerSn: '', // 客户sn
       rules: {
         vinCode: [ { len: 17, message: '请输入正确的车架号(VIN)', trigger: 'change' } ]
       },
       disabled: false, //  查询、重置按钮是否可操作
       warehouseList: [], // 仓库列表
-      vinInfoData: null,
+      vinInfoData: null, // vin匹配的车辆信息
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         const _this = this
@@ -353,8 +357,8 @@ export default {
       cityPrice: false, // 城市价
       tyuePrice: false, // 特约价
       zdPrice: false, // 终端价
-      openCarInfoModal: false,
-      onlyList: false
+      openCarInfoModal: false, // 打开车辆信息弹框
+      onlyList: false // 是否重置条件查询
     }
   },
   computed: {
@@ -369,12 +373,14 @@ export default {
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'brandName', width: '120px', align: 'center', sorter: true, customRender: function (text) { return text || '--' } }
       ]
+      // 参考成本价
       if (this.cost) {
         this.tableWidth += 100
         arr.push({ slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       } else {
         this.tableWidth -= 100
       }
+      // 市级价
       if (this.cityPrice && this.$hasPermissions('M_ShowAllCityPrice')) {
         this.tableWidth += 80
         arr.push({ title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })

+ 28 - 17
src/views/salesManagement/salesQueryNew/chooseShelfProduct.vue

@@ -9,7 +9,7 @@
     :wrap-style="{ position: 'absolute' }"
     @close="isShow = false"
     wrapClassName="chooseShelf-modal jg-drawer-wrap"
-     >
+  >
     <a-spin :spinning="spinning" tip="Loading...">
       <a-tabs type="card">
         <a-tab-pane :defaultActiveKey="curTab" v-model="curTab" :key="1" tab="待补货产品">
@@ -39,7 +39,7 @@
                 </a-col>
                 <a-col flex="370px">
                   <a-form-model-item label="库存情况">
-                    <a-select v-model.trim="queryParam.stockStateList" mode="multiple" :options="options" placeholder="请选择库存情况" />
+                    <a-select id="chooseShelf-stockState" v-model.trim="queryParam.stockStateList" mode="multiple" :options="options" placeholder="请选择库存情况" />
                   </a-form-model-item>
                 </a-col>
                 <a-col flex="auto" style="margin-bottom: 10px;">
@@ -50,7 +50,7 @@
             </a-form-model>
             <div class="table-operator">
               <div>
-                <a-button type="primary" @click="handlePlAdd">批量添加</a-button>
+                <a-button id="chooseShelf-handlePlAdd" type="primary" @click="handlePlAdd">批量添加</a-button>
                 <span style="margin-left: 10px;" v-if="selectTotal">已选{{ selectTotal }}项</span>
               </div>
               <div>
@@ -77,6 +77,7 @@
               <template slot="salePrice" slot-scope="text, record">
                 <div style="display: flex;align-items: center;" @dblclick.stop>
                   <a-input-number
+                    :id="'chooseP-price-'+record.id"
                     size="small"
                     v-model="record.price"
                     :precision="2"
@@ -92,6 +93,7 @@
               <template slot="nums" slot-scope="text, record">
                 <div @dblclick.stop>
                   <a-input-number
+                    :id="'chooseP-qty-'+record.id"
                     size="small"
                     v-model="record.salesNums"
                     :precision="0"
@@ -109,14 +111,14 @@
                   class="button-primary"
                   @click.stop="handleAdd(record)"
                   v-if="record.includeFlag != 1"
-                  id="productInfoList-edit-btn">添加</a-button>
+                  :id="'chooseP-add-'+record.id">添加</a-button>
                 <span style="color:#999;" v-else>已添加</span>
                 <a-button
                   size="small"
                   type="link"
                   class="button-primary"
                   @click.stop="handleDetail(record)"
-                  id="productInfoList-detail-btn"
+                  :id="'chooseP-record-'+record.id"
                   style="margin-left: 5px;">销售记录</a-button>
               </template>
             </s-table>
@@ -189,20 +191,20 @@ export default {
       type: Boolean,
       default: false
     },
-    baseData: {
+    baseData: { // 单据信息
       type: Object,
       default: function () {
         return null
       }
     },
-    width: {
+    width: { // 弹框宽度
       type: [String, Number],
       default: '80%'
     },
-    zIndex: {
+    zIndex: { // 弹框层级
       type: Number,
       default: 100
-    },
+    }
   },
   data () {
     return {
@@ -214,16 +216,16 @@ export default {
         { label: '部分缺货', value: 'portionStockout' },
         { label: '全部缺货', value: 'allStockout' }
       ],
-      curTab: 1,
-      tableHeight:0,
-      productType: [],
+      curTab: 1, // 当前页签
+      tableHeight: 0, // 表格高度
+      productType: [], // 产品类型
       queryParam: {
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        stockStateList: []
+        stockStateList: [] // 库存状态
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -232,7 +234,7 @@ export default {
         this.queryParam.customerSn = this.baseData.customerSn
         this.queryParam.salePriceType = this.baseData.salePriceType
         this.queryParam.salesBillSn = this.baseData.salesBillSn
-
+        // 查询列表
         return queryWaitReplenish(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -252,7 +254,7 @@ export default {
       },
       rowSelectionInfo: null,
       // -------- 全部产品 --------
-      productType1: [],
+      productType1: [], // 产品类型1
       queryParam1: {
         productCode: '', //  产品编码
         productName: '', //  产品名称
@@ -284,12 +286,15 @@ export default {
     }
   },
   computed: {
+    // 弹框标题
     mtitle () {
       return '货架产品' + (this.baseData && this.baseData.shelfName ? this.baseData.shelfName : '')
     },
+    // 已选数量
     selectTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
     },
+    // 列定义
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -309,6 +314,7 @@ export default {
       ]
       return arr
     },
+    // 列定义2
     columns1 () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -325,12 +331,13 @@ export default {
     }
   },
   methods: {
+    // 取消操作
     cansel () {
       this.isShow = false
     },
     // 销售记录
     handleDetail (row) {
-      this.$emit('viewRecord',row)
+      this.$emit('viewRecord', row)
     },
     // 表格选中项
     rowSelectionFun (obj) {
@@ -365,6 +372,7 @@ export default {
         this.$message.info('请选择产品')
       }
     },
+    // 重置列表
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -377,6 +385,7 @@ export default {
       this.$refs.table.clearSelected()
       this.$refs.table.refresh(true)
     },
+    // 加载完成
     reload () {
       this.$refs.table.clearSelected()
       this.$refs.table.refresh()
@@ -388,6 +397,7 @@ export default {
       this.queryParam1.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam1.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 重置表格2
     resetSearchForm1 () {
       this.queryParam1.productCode = ''
       this.queryParam1.productName = ''
@@ -398,9 +408,10 @@ export default {
       this.$refs.ruleForm1.resetFields()
       this.$refs.table1.refresh(true)
     },
+    // 计算表格高度
     setTableH () {
       this.$nextTick(() => {
-        this.tableHeight = window.innerHeight - (this.curTab == 1 ? this.$refs.searchBox.offsetHeight : this.$refs.searchBox1.offsetHeight) - 255 
+        this.tableHeight = window.innerHeight - (this.curTab == 1 ? this.$refs.searchBox.offsetHeight : this.$refs.searchBox1.offsetHeight) - 255
       })
     }
   },

+ 30 - 22
src/views/salesManagement/salesQueryNew/detail.vue

@@ -116,7 +116,13 @@
             </template>
             <!-- 操作 -->
             <template slot="action" slot-scope="text, record">
-              <a-button size="small" type="link" v-if="record.oosFlag == 0 && (isOwerEdit || isAudit)" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
+              <a-button
+                :id="'sales-detail-out-'+record.id"
+                size="small"
+                type="link"
+                v-if="record.oosFlag == 0 && (isOwerEdit || isAudit)"
+                class="button-primary"
+                @click="handleViewDetail(record)">出库明细</a-button>
               <span v-else>--</span>
             </template>
           </s-table>
@@ -131,12 +137,14 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { getOperationalPrecision } from '@/libs/tools.js'
+import { hdPrint } from '@/libs/JGPrint'
+// 组件
 import { STable, VSelect } from '@/components'
-import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
-import { salesDetailList } from '@/api/salesDetail'
 import outInDetialModal from './outInDetialModal.vue'
 import PrintPanel from '@/views/common/printPanel.vue'
-import { hdPrint } from '@/libs/JGPrint'
+// 接口
+import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
+import { salesDetailList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
   components: { STable, VSelect, PrintPanel, outInDetialModal },
@@ -149,15 +157,15 @@ export default {
   },
   data () {
     return {
-      showPage: false,
+      showPage: false, // 是否显示组件
       spinning: false,
       disabled: false,
-      showCost: false,
-      printOrgCode: false, // 打印原创编码
-      printAllName: false, // 打印全部名称
-      printRemarks: false,
-      printPrice: false,
-      showOutInModal: false,
+      showCost: false, // 是否显示成本价
+      printOrgCode: false, // 是否打印原创编码
+      printAllName: false, // 是否打印全部名称
+      printRemarks: false, // 是否打印备注
+      printPrice: false, // 是否打印价格
+      showOutInModal: false, // 出库明细弹框
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -187,7 +195,7 @@ export default {
           return data
         })
       },
-      localDataSource: [],
+      localDataSource: [], // 原始列表数据
       detailData: null, //  详情数据
       isShowBisiceInfo: false// 显示基础内容
     }
@@ -201,6 +209,7 @@ export default {
     isAudit () {
       return this.detailData ? (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH') : false
     },
+    // 列定义
     columns () {
       const _this = this
       const arr = [
@@ -242,10 +251,10 @@ export default {
       const _this = this
       _this.spinning = true
       let url = salesDetailPrint
-      const params = { 
-        sn: this.outBizSn || this.$route.params.sn, 
-        printOrgCode: this.printOrgCode ? 1 : 0, 
-        printAllName: this.printAllName ? 1 : 0, 
+      const params = {
+        sn: this.outBizSn || this.$route.params.sn,
+        printOrgCode: this.printOrgCode ? 1 : 0,
+        printAllName: this.printAllName ? 1 : 0,
         remarksShowFlag: this.printRemarks ? 1 : 0,
         priceFlag: this.printPrice ? 1 : 0
       }
@@ -261,11 +270,6 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesNewList' })
     },
-    // 编辑
-    // handleEdit () {
-    //   const row = this.detailData
-    //   this.$router.push({ name: 'salesNewEdit', params: { id: row.id, sn: row.salesBillSn, priceType: row.priceType } })
-    // },
     //  详情
     getDetail () {
       salesDetailBySn({ salesBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
@@ -276,11 +280,12 @@ export default {
         }
       })
     },
-    // 出入库明细
+    // 打开出入库明细
     handleViewDetail (row) {
       this.showOutInModal = true
       this.$refs.outInDetialModal.getData(row)
     },
+    // 页面初始
     pageInit () {
       const vm = this
       vm.$nextTick(() => {
@@ -291,12 +296,15 @@ export default {
         vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
         vm.printRemarks = localStorage.getItem('printRemarks-' + this.$store.state.user.info.orgId) == 'true'
         vm.printPrice = localStorage.getItem('printPrice-' + this.$store.state.user.info.orgId) == 'true'
+        // 查询列表
         vm.$refs.table.refresh(true)
+        // 获取单据详情
         vm.getDetail()
       })
     }
   },
   watch: {
+    // 打印选项变化
     printOrgCode (newValue, oldValue) {
       localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
     },

+ 61 - 41
src/views/salesManagement/salesQueryNew/edit.vue

@@ -35,7 +35,7 @@
           <a-button v-if="detailData&&detailData.totalCategory" id="salesNewOrderEdit-add-btn" type="link" @click="openChooseProduct=true"><a-icon type="plus" />添加产品</a-button>
           <a-divider type="vertical" v-if="detailData&&detailData.totalCategory" />
           <a-dropdown v-model="showCell" v-if="$hasPermissions('M_ShowAllCost')&&detailData&&detailData.totalCategory">
-            <a-button type="link" class="button-default"> <a-icon type="setting" />  显示</a-button>
+            <a-button type="link" class="button-default" id="salesQuery-edit-showCell"> <a-icon type="setting" />  显示</a-button>
             <a-menu slot="overlay">
               <a-menu-item>
                 <a-checkbox v-model="isCosts" id="salesQuery-edit-cost">成本价</a-checkbox>
@@ -44,21 +44,21 @@
           </a-dropdown>
           <a-divider type="vertical" v-if="$hasPermissions('M_ShowAllCost')"/>
           <a-dropdown>
-            <a-menu slot="overlay" @click="handleActions">
-              <a-menu-item key="4">
+            <a-menu slot="overlay" @click="handleActions" id="salesQuery-edit-action-menus">
+              <a-menu-item key="4" id="salesQuery-edit-import">
                 <a-icon type="import" />导入产品
               </a-menu-item>
-              <a-menu-item key="3" v-if="shelfInfo&&shelfInfo.state=='ENABLE'">
+              <a-menu-item key="3" v-if="shelfInfo&&shelfInfo.state=='ENABLE'" id="salesQuery-edit-shelfproduct">
                 <a-icon type="hdd"/>货架产品
               </a-menu-item>
-              <a-menu-item key="2">
+              <a-menu-item key="2" id="salesQuery-edit-delAll">
                 <a-icon type="close-square"/>清空列表
               </a-menu-item>
-              <a-menu-item key="1">
+              <a-menu-item key="1" id="salesQuery-edit-delJdOrQh">
                 <a-icon type="rest" style="font-size: 14px;" />{{ isOwerEdit?'删除急件':'删除缺货' }}
               </a-menu-item>
             </a-menu>
-            <a-button type="link" class="button-default"> <a-icon type="unordered-list" />  更多</a-button>
+            <a-button id="salesQuery-edit-moreBtn" type="link" class="button-default"> <a-icon type="unordered-list" />  更多</a-button>
           </a-dropdown>
         </div>
       </template>
@@ -72,17 +72,17 @@
             <a-row :gutter="10">
               <a-col :md="5" :sm="24">
                 <a-form-model-item label="产品编码">
-                  <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
+                  <a-input id="salesQuery-edit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
                 </a-form-model-item>
               </a-col>
               <a-col :md="5" :sm="24">
                 <a-form-model-item label="产品名称">
-                  <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
+                  <a-input id="salesQuery-edit-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
                 </a-form-model-item>
               </a-col>
               <a-col :md="4" :sm="24" v-if="isOwerEdit">
                 <a-form-item label="是否为急件">
-                  <a-select allowClear v-model="productForm.oosFlag" placeholder="请选择是否">
+                  <a-select id="salesQuery-edit-oosFlag" allowClear v-model="productForm.oosFlag" placeholder="请选择是否">
                     <a-select-option value="1">
                     </a-select-option>
@@ -172,6 +172,7 @@
               </div>
               <a-input-number
                 size="small"
+                :id="'salesEdit-price-'+record.id"
                 v-model="record.price"
                 :precision="2"
                 :min="0"
@@ -185,7 +186,7 @@
           <!-- 销售数量 -->
           <template slot="salesNums" slot-scope="text, record">
             <a-input-number
-              id="salesEdit-salesNums"
+              :id="'salesEdit-salesNums-'+record.id"
               size="small"
               v-model="record.qty"
               :precision="0"
@@ -197,14 +198,20 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button size="small" v-if="record.oosFlag == 0 && isOwerEdit" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
+            <a-button
+              :id="'salesEdit-viewRecord-'+record.id"
+              size="small"
+              v-if="record.oosFlag == 0 && isOwerEdit"
+              type="link"
+              class="button-primary"
+              @click="handleViewDetail(record)">出库明细</a-button>
             <a-button
               size="small"
               type="link"
               :loading="delLoading"
               class="button-error"
               @click="handleDel(record)"
-              id="productInfoList-Del">删除</a-button>
+              :id="'salesEdit-del-'+record.id">删除</a-button>
           </template>
         </s-table>
       </div>
@@ -217,7 +224,7 @@
             }"
           >
             <span slot="description"> 暂无产品 </span>
-            <a-button type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
+            <a-button id="salesEdit-newAddProduct" type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
           </a-empty>
         </div>
         <div style="text-align: center;padding: 30px 50px;" v-if="spinning">
@@ -245,7 +252,7 @@
             <div style="display: inline-block;">
               折扣金额:
               <a-input-number
-                id="discount"
+                id="salesEdit-discount"
                 size="small"
                 v-model.trim="detailData.discountAmount"
                 @blur="salesDiscount"
@@ -266,7 +273,7 @@
               <a-menu-item key="2"> <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox> </a-menu-item>
               <a-menu-item key="3"> <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox></a-menu-item>
             </a-menu>
-            <a-button style="margin-left: 8px" size="large"> 选择同步操作 <a-icon type="down" /> </a-button>
+            <a-button id="salesEdit-tb-action" style="margin-left: 8px" size="large"> 选择同步操作 <a-icon type="down" /> </a-button>
           </a-dropdown>
         </div>
         <div>
@@ -321,34 +328,37 @@
 import { commonMixin } from '@/utils/mixin'
 import { mapActions } from 'vuex'
 import { Empty } from 'ant-design-vue'
+import { hdPrint } from '@/libs/JGPrint'
+// 组件
 import { STable, VSelect } from '@/components'
+import outInDetialModal from './outInDetialModal.vue'
+import chooseShelfProduct from './chooseShelfProduct.vue'
+import PrintPanel from '@/views/common/printPanel.vue'
 import chooseProductModal from './chooseProductModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import importGuideModal from './importGuideModal.vue'
 import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
 import productSalesRecordModal from './productSalesRecordModal.vue'
+// 接口
 import { stockByProductSn } from '@/api/stock'
 import { queryByCustomerSn } from '@/api/shelf'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
-import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport, queryCheckedList } from '@/api/salesDetail'
-import outInDetialModal from './outInDetialModal.vue'
-import chooseShelfProduct from './chooseShelfProduct.vue'
-import PrintPanel from '@/views/common/printPanel.vue'
-import { hdPrint } from '@/libs/JGPrint'
+import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailInsertImport, queryCheckedList } from '@/api/salesDetail'
+
 export default {
   name: 'SalesEdit',
   components: { STable, VSelect, chooseProductModal, chooseCustomModal, PrintPanel, importGuideModal, settleModal, outInDetialModal, chooseShelfProduct, productSalesRecordModal },
   mixins: [commonMixin],
   data () {
     return {
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-      tableHeight: 0,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 默认空图片
+      tableHeight: 0, // 表格高度
       showOutInModal: false, // 出入库明细
-      showCell: false,
-      showPage: false,
+      showCell: false, // 显示列下拉选项
+      showPage: false, // 是否显示组件
       spinning: false,
-      showSearch: false,
-      openChooseProduct: false,
+      showSearch: false, // 是否显示查询条件
+      openChooseProduct: false, // 是否显示产品列表弹框
       orderId: null, // 销售单id
       salesBillSn: null, // 销售单sn
       disabled: false, //  查询、重置按钮是否可操作
@@ -360,20 +370,20 @@ export default {
       enableFundAccount: false, // 是否开启资金账户管理
       showShelfModal: false, // 货架产品弹框
       checkedProductList: [], // 已选所有产品
-      delLoading: false,
+      delLoading: false, // 按钮loading
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
-      dataSource: [],
+      dataSource: [], // 原始数据
       productForm: {
-        productName: '',
-        productCode: '',
-        oosFlag: undefined,
-        orderBy: 'sales_bill_detail.CREATE_DATE desc'
+        productName: '', // 产品名称
+        productCode: '', // 产品编码
+        oosFlag: undefined, // 是否急件
+        orderBy: 'sales_bill_detail.CREATE_DATE desc' // 排序
       },
-      tbForm: [], // 同步操作
-      printOrgCode: false, // 打印原创编码
-      printAllName: false, // 打印全部名称
-      printRemarks: false, // 打印备注
-      printPrice: false,
+      tbForm: [], // 同步操作选项值
+      printOrgCode: false, // 是否打印原创编码
+      printAllName: false, // 是否打印全部名称
+      printRemarks: false, // 是否打印备注
+      printPrice: false, // 是否打印价格
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -387,6 +397,7 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              // 缓存数量和价格
               data.list[i].qtyBackups = data.list[i].qty
               data.list[i].priceBackups = data.list[i].price
             }
@@ -400,7 +411,7 @@ export default {
       printerType: 'NEEDLE', //  打印机类型
       isCosts: false, // 是否显示成本价
       shelfInfo: null, // 是否有货架
-      discountAmountBak: null
+      discountAmountBak: null // 折扣备份数据
     }
   },
   computed: {
@@ -412,6 +423,7 @@ export default {
     isAudit () {
       return this.detailData && (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH')
     },
+    // 列定义
     columns () {
       const _this = this
       const arr = [
@@ -445,10 +457,13 @@ export default {
   },
   methods: {
     ...mapActions(['GetSettleAccountState']),
+    // 更多操作
     handleActions (e) {
+      // 导入产品
       if (e.key == 4) {
         this.openGuideModal = true
       }
+      // 货架产品
       if (e.key == 3) {
         this.showShelfModal = true
       }
@@ -480,6 +495,7 @@ export default {
         _this.$refs.printBox.hovered = false
       })
     },
+    // 选择同步操作选项
     tbFormChange (e, val) {
       this.tbForm = []
       const tbTypes = ['AUDIT', 'STOCK_OUT', 'SETTLE']
@@ -672,7 +688,6 @@ export default {
     },
     // 删除产品
     handleDel (row) {
-      row
       const _this = this
       this.$confirm({
         title: '提示',
@@ -684,6 +699,7 @@ export default {
           _this.spinning = true
           salesDetailDel({ id: row.id }).then(res => {
             if (res.status == 200) {
+              // 更新详情
               _this.getOrderDetail(false, true)
             }
             _this.$message.info(res.message)
@@ -894,9 +910,11 @@ export default {
         this.spinning = false
       })
     },
+    // 计算表格高度
     setTableH () {
       this.tableHeight = window.innerHeight - (this.showSearch ? 42 : 0) - 300
     },
+    // 页面初始话
     pageInit () {
       const vm = this
       vm.$nextTick(() => {
@@ -908,11 +926,13 @@ export default {
         vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
         vm.printRemarks = localStorage.getItem('printRemarks-' + this.$store.state.user.info.orgId) == 'true'
         vm.printPrice = localStorage.getItem('printPrice-' + this.$store.state.user.info.orgId) == 'true'
+        // 获取详情
         vm.getOrderDetail(true)
       })
     }
   },
   watch: {
+    // 打印选项缓存
     printOrgCode (newValue, oldValue) {
       localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
     },
@@ -948,7 +968,7 @@ export default {
     if (this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')) {
     	this.GetSettleAccountState().then(res => {
     	  if (res.status == 200) {
-    		this.enableFundAccount = res.data.functionEnableFlag == 1
+          this.enableFundAccount = res.data.functionEnableFlag == 1
     	  }
     	})
     }

+ 6 - 6
src/views/salesManagement/salesQueryNew/importGuideModal.vue

@@ -77,7 +77,7 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
+    params: { // 参数
       type: Object,
       default: null
     }
@@ -86,13 +86,13 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/salesDetail/importDetail',
-      paramsData: null,
-      uploadParams: {
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/salesDetail/importDetail', // 接口
+      paramsData: null, // 单据信息
+      uploadParams: { // 上传参数
         savePathType: 'local',
         salesBillSn: this.params.salesBillSn
       },
-      filePath: location.protocol + '//' +location.host + '/templ/销售单产品明细导入模板.xlsx'
+      filePath: location.protocol + '//' + location.host + '/templ/销售单产品明细导入模板.xlsx' // 下载模板
     }
   },
   methods: {
@@ -129,7 +129,7 @@ export default {
     handleClose () {
       this.openImportModal = false
       this.isShow = false
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 45 - 30
src/views/salesManagement/salesQueryNew/list.vue

@@ -264,11 +264,12 @@ import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import auditModal from '@/views/common/auditModal.vue'
-import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import stateIcon from '@/views/common/stateIcon'
+// 接口
+import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
 import moment from 'moment'
 export default {
   name: 'SalesList',
@@ -277,44 +278,44 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       openModal: false, // 选择客户弹框是否显示
       isByCustQuery: false, // 是否按客户查询
-      showDiscount: false,
-      showCell: false,
-      time: [
+      showDiscount: false, // 显示折后总售价
+      showCell: false, // 显示下拉选项
+      time: [ // 创建时间
         getDate.getMonthDays(3).starttime,
         getDate.getMonthDays(3).endtime
       ],
-      auditTime: [],
-      outWareTime: [],
+      auditTime: [], // 审核时间
+      outWareTime: [], // 出库时间
       // 查询参数
       queryParam: {
-        beginDate: getDate.getMonthDays(3).starttime,
-        endDate: getDate.getMonthDays(3).endtime,
-        auditBeginDate: '',
-        auditEndDate: '',
-        outWarehouseBeginDate: '',
-        outWarehouseEndDate: '',
+        beginDate: getDate.getMonthDays(3).starttime, // 开始创建时间
+        endDate: getDate.getMonthDays(3).endtime, // 结束创建时间
+        auditBeginDate: '', // 开始审核时间
+        auditEndDate: '', // 结束审核时间
+        outWarehouseBeginDate: '', // 开始出库时间
+        outWarehouseEndDate: '', // 结束出库时间
         buyerNameCurrent: undefined, //  客户名称
-        buyerSn: undefined,
+        buyerSn: undefined, // 客户sn
         salesBillNo: '', //  销售单号
         purchaseBillNo: '', //  采购单号
         payType: undefined, //  支付方式
         settleStyleSn: undefined, //  收款方式
         billStatus: undefined, //  业务状态
         financialStatus: undefined, //  财务状态
-        sourceType: undefined,
-        distributionFlag: undefined
+        sourceType: undefined, // 单据来源
+        distributionFlag: undefined // 是否铺货出库
       },
-      totalData: {
-        totalAmount: 0,
-        totalCategory: 0,
-        totalQty: 0,
-        totalRecord: 0
+      totalData: { // 统计数据
+        totalAmount: 0, // 总销价
+        totalCategory: 0, // 总款数
+        totalQty: 0, // 总数量
+        totalRecord: 0 // 总条数
       },
       selType: '0', // 0零售 1铺货
       // 加载数据方法 必须为 Promise 对象
@@ -325,6 +326,7 @@ export default {
         salesCount(Object.assign(parameter, this.queryParam)).then(res => {
           this.totalData = res.data
         })
+        // 查询列表
         return salesList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
@@ -339,10 +341,10 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
-      auditInfo: null,
-      spinningAudit: false,
-      distributionFlag: '0'
+      visibleAudit: false, // 审核弹框
+      auditInfo: null, // 审核信息
+      spinningAudit: false, // 审核操作loading
+      distributionFlag: '0' // 是否铺货
     }
   },
   computed: {
@@ -379,21 +381,24 @@ export default {
     }
   },
   methods: {
-    //  时间  change
+    // 选择创建时间
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 选择审核时间
     auditDateChange (date) {
       this.auditTime = date
       this.queryParam.auditBeginDate = date[0]
       this.queryParam.auditEndDate = date[1]
     },
+    // 选择出库时间
     outWareDateChange (date) {
       this.outWareTime = date
       this.queryParam.outWarehouseBeginDate = date[0]
       this.queryParam.outWarehouseEndDate = date[1]
     },
+    // 选择客户
     custChange (v, row) {
       console.log(v, row)
       if (row && row.customerSn) {
@@ -404,16 +409,17 @@ export default {
         this.queryParam.buyerSn = undefined
       }
     },
-    // 新增
+    // 打开新增弹框
     handleAdd (flag) {
       this.openModal = true
       this.distributionFlag = flag
     },
-    //  审核
+    //  打开审核弹框
     handleEexamine (row) {
       this.auditInfo = row
       this.visibleAudit = true
     },
+    // 提交审核
     auditOrder (billStatus) {
       this.spinningAudit = true
       salesWriteAudit({
@@ -493,16 +499,20 @@ export default {
         }
       })
     },
+    // 查询列表
     searchForm (flag) {
+      // 是否按客户查询
       if (!this.isByCustQuery) {
         const a = moment(this.queryParam.beginDate)
         const b = moment(this.queryParam.endDate)
+        // 最多只能选择2年的时间区间
         if (b.diff(a, 'days') > 730) {
           this.$message.info('最多只能选择2年的时间区间')
           return false
         }
         this.$refs.table.refresh(!flag)
       } else {
+        // 按客户查询
         if (this.queryParam.buyerSn) {
           this.$refs.table.refresh(!flag)
         } else {
@@ -545,6 +555,7 @@ export default {
       this.queryParam.distributionFlag = undefined
       this.$refs.custList.resetForm()
       if (!flag) {
+        // 重置单据状态
         this.setIsHomeNav(this.$route.name, null)
       }
     },
@@ -573,10 +584,12 @@ export default {
         }
       })
     },
+    // 表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 267
     },
+    // 初始化页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -588,7 +601,6 @@ export default {
       const b = this.$store.state.app.updateList
       // 是否从首页点击进入
       const isHomeNav = this.getIsHomeNav()[this.$route.name]
-      console.log(a, b)
 
       // 从首页进入,判断式新建还式待办查询
       if (isHomeNav) {
@@ -617,15 +629,18 @@ export default {
     }
   },
   watch: {
+    // 展开收起查询条件
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
-    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+    //  窗口变更时,需同时更改表格高度
+    '$store.state.app.winHeight' (newValue, oldValue) {
       this.setTableH()
     },
+    // 按客户查询复选框变更
     isByCustQuery (newValue, oldValue) {
       if (!newValue) {
         this.resetSearchForm()

+ 13 - 9
src/views/salesManagement/salesQueryNew/outInDetialModal.vue

@@ -1,5 +1,5 @@
 <template>
-    <a-drawer
+  <a-drawer
     :zIndex="1010"
     title="出库明细"
     placement="right"
@@ -9,7 +9,7 @@
     :wrap-style="{ position: 'absolute' }"
     @close="isShow = false"
     wrapClassName="outIndetail-modal jg-drawer-wrap"
-     >
+  >
     <a-spin :spinning="spinning" tip="Loading..." v-if="isShow">
       <div class="baseInfo" ref="searchBox" v-if="baseData">
         <div>
@@ -52,7 +52,7 @@ export default {
       type: Boolean,
       default: false
     },
-    outBizType: {
+    outBizType: { // 出库类型 SHOP_CALL_OUT(店内调出)   /  SALES (销售)
       type: String,
       default: ''
     }
@@ -61,13 +61,12 @@ export default {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      tableHeight: 0,
-      baseData: null,
+      tableHeight: 0, // 表格高度
+      baseData: null, // 单据详情信息
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        // outBizType = SHOP_CALL_OUT(店内调出)   /  SALES (销售)
         const params = this.baseData
         console.log(params)
         const queryParams = { outBizType: this.outBizType, productSn: params.productSn }
@@ -100,6 +99,7 @@ export default {
     }
   },
   computed: {
+    // 列定义
     columns () {
       const _this = this
       const arr = [
@@ -112,24 +112,28 @@ export default {
         { title: '本次出库数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
+      // 是否有成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ?  _this.toThousands(text) : '--') } })
-        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ?  _this.toThousands(text) : '--') } })
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
   },
   methods: {
+    // 计算表格高度
     setTableH () {
       this.$nextTick(() => {
         const searchBoxH = this.$refs.searchBox.offsetHeight
         this.tableHeight = window.innerHeight - searchBoxH - 235
       })
     },
+    // 关闭弹框
     cansel () {
       this.isShow = false
       this.baseData = null
     },
+    // 查询列表
     getData (row) {
       this.baseData = row
       this.$nextTick(() => {
@@ -149,7 +153,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-      }else{
+      } else {
         this.setTableH()
       }
     }

+ 56 - 52
src/views/salesManagement/salesQueryNew/productSalesRecordModal.vue

@@ -1,50 +1,51 @@
 <template>
   <a-drawer
-      placement="right"
-      :title="modalTit"
-      :visible="isShow"
-      :get-container="false"
-      :wrap-style="{ position: 'absolute' }"
-      @close="isShow=false"
-      :z-index="150"
-      wrapClassName="salesRecord-modal jg-drawer-wrap"
-      width="70%">
-      <div v-if="isShow">
-        <div ref="searchBox">
-          <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
-            <div style="flex:1">产品编码:{{ baseData.productCode }}</div>
-            <div style="flex:1">产品名称:{{ baseData.productName }}</div>
-          </div>
-          <a-tabs size="small" type="card" v-model="curTab" @change="callback">
-            <a-tab-pane key="1" tab="当前客户">
-            </a-tab-pane>
-            <a-tab-pane key="2" tab="全部客户">
-            </a-tab-pane>
-          </a-tabs>
+    placement="right"
+    :title="modalTit"
+    :visible="isShow"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    @close="isShow=false"
+    :z-index="150"
+    wrapClassName="salesRecord-modal jg-drawer-wrap"
+    width="70%">
+    <div v-if="isShow">
+      <div ref="searchBox">
+        <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
+          <div style="flex:1">产品编码:{{ baseData.productCode }}</div>
+          <div style="flex:1">产品名称:{{ baseData.productName }}</div>
         </div>
-        <!-- 表格 -->
-        <a-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.id"
-          :scroll="{ y: tableHeight }"
-          :columns="columns"
-          :dataSource="list"
-          :loading="loading"
-          :pagination="false"
-          bordered>
-        </a-table>
-        <!-- 分页 -->
-        <tablePagination
-          ref="tablePagination"
-          :total="paginationProps.total"
-          :current="paginationProps.current"
-          :pageSize="paginationProps.pageSize"
-          @changePageSize="changePageSize"
-          @changePage="changePage" />
+        <a-tabs id="sales-record-tab" size="small" type="card" v-model="curTab" @change="callback">
+          <a-tab-pane key="1" tab="当前客户" id="sales-record-tab1">
+          </a-tab-pane>
+          <a-tab-pane key="2" tab="全部客户" id="sales-record-tab2">
+          </a-tab-pane>
+        </a-tabs>
       </div>
-    </a-drawer>
+      <!-- 表格 -->
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :scroll="{ y: tableHeight }"
+        :columns="columns"
+        :dataSource="list"
+        :loading="loading"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 分页 -->
+      <tablePagination
+        id="sales-record-pgeination"
+        ref="tablePagination"
+        :total="paginationProps.total"
+        :current="paginationProps.current"
+        :pageSize="paginationProps.pageSize"
+        @changePageSize="changePageSize"
+        @changePage="changePage" />
+    </div>
+  </a-drawer>
 </template>
 
 <script>
@@ -61,7 +62,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemId: { // 单据id
       type: [Number, String],
       default: ''
     }
@@ -75,10 +76,10 @@ export default {
     const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
-      tableHeight: 0,
-      buyerSn: null,
+      tableHeight: 0, // 表格高度
+      buyerSn: null, // 客户sn
       queryParam: {
-        productSn: null
+        productSn: null // 产品sn
       },
       // 表头
       columns: [
@@ -87,18 +88,19 @@ export default {
         { title: '销售数量', dataIndex: 'qty', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '客户名称', dataIndex: 'salesBillEntity.buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
-      list: [],
+      list: [], // 列表数据
       loading: false,
-      curTab: '1',
+      curTab: '1', // 当前页签
       paginationProps: {
         total: 0, //  分页总条数
-        current: 1,
-        pageSize: 20
+        current: 1, // 当前页
+        pageSize: 20 // 每页数
       },
-      baseData: null
+      baseData: null // 基础信息
     }
   },
   methods: {
+    // 计算表格高度
     setTableH () {
       this.$nextTick(() => {
         const searchBoxH = this.$refs.searchBox.offsetHeight
@@ -153,6 +155,7 @@ export default {
       this.paginationProps.current = current
       this.handelSearch()
     },
+    // 选择选项卡tab后
     callback (key) {
       this.curTab = key
       this.getDetail(this.buyerSn, this.queryParam.productSn, this.baseData)
@@ -170,6 +173,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置数据
         this.paginationProps.total = 0
         this.paginationProps.current = 1
         this.paginationProps.pageSize = 20