Browse Source

销售单加id

lilei 1 year ago
parent
commit
0490650011

+ 1 - 1
public/version.json

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

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

@@ -52,7 +52,7 @@ export default {
       type: Boolean,
       default: false
     },
-    infoData: {
+    infoData: { // 基本信息
       type: Object,
       default: () => {
         return {}
@@ -62,10 +62,11 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      defImg
+      defImg // 默认图片
     }
   },
   methods: {
+    // 预览图片
     inited (viewer) {
       if (viewer) {
         const imageUrl = []

+ 28 - 21
src/views/salesManagement/salesQuery/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 type="primary" id="chooseCustom-add" 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>
@@ -185,6 +186,7 @@
           :maskClosable="false"
           @cancel="cancelNewCust"
           :footer="null"
+          id="chooseCustom-newCustModal"
         >
           <CustomerManagementEdit ref="newCust" model="modal" @ok="newCustFun"></CustomerManagementEdit>
         </a-modal>
@@ -194,10 +196,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 +210,8 @@ export default {
   name: 'ChooseCustomModal',
   components: { VSelect, CustomerManagementEdit, selectCust, settleStyle },
   props: {
-    show: [Boolean],
-    distributionFlag: {
+    show: [Boolean], // 是否显示弹框
+    distributionFlag: { // 是否铺货出库
       type: [String, Number],
       default: '0'
     }
@@ -215,9 +219,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 +232,7 @@ export default {
         buyerName: '', // 客户名称
         buyerSn: undefined, // 客户sn
         consigneeTel: '', //  联系电话
-        consigneeMobile: '',
+        consigneeMobile: '', // 联系电话1
         consigneeName: '', //  联系人
         shippingAddressProvinceSn: undefined, //  省
         shippingAddressProvinceName: '',
@@ -243,9 +247,9 @@ export default {
         priceType: undefined, //  价格类型
         settleStyleSn: undefined, //  收款方式
         salesManSn: undefined, //  业务员
-        salesManName: '',
+        salesManName: '', // 业务员名称
         distributionFlag: undefined, // 铺货出库
-        salesTragetType: 'CUSTOMER',
+        salesTragetType: 'CUSTOMER', // 销售目标类型
         remarks: '' //  备注
       },
       rules: {
@@ -288,25 +292,27 @@ export default {
     }
   },
   methods: {
+    // 选择价格类型
     changePriceType (v) {
       this.form.priceType = v
       this.$refs.ruleForm.clearValidate('priceType')
     },
+    // 打开新增客户弹框
     openNewCust () {
       this.isNewCust = true
       setTimeout(() => {
         this.$refs.newCust.getBaseData()
       }, 500)
     },
-    // 新建客户
+    // 新建客户成功后
     newCustFun (data) {
-      console.log(data, this.isEdit)
+      // console.log(data, this.isEdit)
       this.isNewCust = false
       // 更新客户信息
       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
+    // 客户变更 change
     custChange (obj) {
       const _this = this
       if (obj && obj.key) {
@@ -348,7 +354,7 @@ export default {
     },
     // 编辑客户信息
     editCust (data) {
-      console.log(data)
+      // console.log(data)
       this.title = '编辑客户信息'
       this.isEdit = true
       this.priceTypeDisabled = true
@@ -359,6 +365,7 @@ export default {
       this.buyerSnBak = this.form.buyerSn
       this.priceTypeBak = this.form.priceType
       this.$nextTick(() => {
+        // 客户组件赋值
         this.$refs.custList.setData({ key: data.buyerSn, label: data.buyerNameCurrent || data.buyerName, row: data })
       })
     },
@@ -367,7 +374,6 @@ export default {
       this.spinning = true
       custFindById({ id: this.custId }).then(res => {
         const data = res.data
-        console.log(res)
         if (res.status == 200 && data) {
           if (data.provinceSn) { this.getArea('city', data.provinceSn) }
           if (data.citySn) { this.getArea('district', data.citySn) }
@@ -400,10 +406,10 @@ export default {
         this.spinning = false
       })
     },
-    // 保存客户信息
+    // 保存更新客户信息
     handleSaveCust () {
       const params = {
-        customerName: this.form.buyerName,
+        customerName: this.form.buyerName, // 客户名称
         customerSn: this.form.buyerSn,
         contactTel: this.form.consigneeTel, //  联系电话
         contactMobile: this.form.consigneeMobile,
@@ -431,11 +437,11 @@ export default {
         }
       })
     },
-    //  保存
+    //  保存销售单客户信息
     handleSubmit (e) {
       e.preventDefault()
       const _this = this
-      console.log(_this.form, '------save')
+      // console.log(_this.form, '------save')
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           // 如果价格类型改变,提示
@@ -454,7 +460,6 @@ export default {
             _this.handleSaveCust()
           }
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -478,12 +483,14 @@ export default {
         }
       })
     },
+    // 取消新建销售单
     cancel () {
       this.opened = false
       this.$emit('cancel')
       this.$refs.ruleForm.resetFields()
       this.$refs.custList.resetForm()
     },
+    // 取消新增客户弹框
     cancelNewCust () {
       this.isNewCust = false
       this.$refs.newCust.getBaseData()
@@ -570,8 +577,8 @@ export default {
         this.getUserAllList()
       }
     },
+    // 是否铺货出库
     distributionFlag (newValue, oldValue) {
-      console.log(newValue, oldValue)
       this.form.distributionFlag = newValue.toString()
     }
   }

+ 7 - 2
src/views/salesManagement/salesQuery/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) {

+ 31 - 20
src/views/salesManagement/salesQuery/chooseShelfProduct.vue

@@ -37,7 +37,7 @@
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="库存情况">
-                    <a-checkbox-group v-model.trim="queryParam.stockStateList" :options="options" />
+                    <a-checkbox-group id="chooseShelf-stockState" v-model.trim="queryParam.stockStateList" :options="options" />
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="4" :sm="12" style="margin-bottom: 10px;">
@@ -50,7 +50,7 @@
           <div class="chooseShelf-modal-table">
             <div class="table-operator">
               <div>
-                <a-button type="primary" @click="handlePlAdd">批量添加</a-button>
+                <a-button id="chooseShelf-plAdd" type="primary" @click="handlePlAdd">批量添加</a-button>
                 <span style="margin-left: 10px;" v-if="selectTotal">已选{{ selectTotal }}项</span>
               </div>
               <div>
@@ -91,6 +91,7 @@
               <template slot="nums" slot-scope="text, record">
                 <div @dblclick.stop>
                   <a-input-number
+                    :id="'chooseShelf-salesNums-'+record.id"
                     size="small"
                     v-model="record.salesNums"
                     :precision="0"
@@ -108,14 +109,15 @@
                   class="button-primary"
                   @click.stop="handleAdd(record)"
                   v-if="record.includeFlag != 1"
-                  id="productInfoList-edit-btn">添加</a-button>
+                  :id="'chooseShelf-edit-'+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="'chooseShelf-record-'+record.id"
                   style="margin-left: 5px;">销售记录</a-button>
               </template>
             </s-table>
@@ -181,6 +183,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
 import ProductType from '../../common/productType.js'
 import productSalesRecordModal from './productSalesRecordModal.vue'
+// 接口
 import { queryWaitReplenish, queryShelfProduct } from '@/api/shelfReplenish'
 export default {
   name: 'OutinDetailModal',
@@ -192,7 +195,7 @@ export default {
       type: Boolean,
       default: false
     },
-    baseData: {
+    baseData: { // 基础信息
       type: Object,
       default: function () {
         return null
@@ -201,24 +204,24 @@ export default {
   },
   data () {
     return {
-      spinning: false,
-      advanced: false,
-      showRecord: false,
+      spinning: false, // 加载动画
+      advanced: false, // 展开收起查询条件
+      showRecord: false, // 销售记录弹框
       isShow: this.openModal, //  是否打开弹框
-      options: [
+      options: [ // 库存状态
         { label: '库存充足', value: 'stockEnough' },
         { label: '部分缺货', value: 'portionStockout' },
         { label: '全部缺货', value: 'allStockout' }
       ],
-      curTab: 1,
-      productType: [],
+      curTab: 1, // 当前页签
+      productType: [], // 产品分类值
       queryParam: {
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        stockStateList: []
+        stockStateList: [] // 库存状态
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -227,7 +230,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) {
@@ -244,9 +247,9 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null,
-      // -------- 全部产品 --------
-      productType1: [],
+      rowSelectionInfo: null, // 已选产品
+      // -------------------- 全部产品 -----------------------------------------
+      productType1: [], // 产品分类1
       queryParam1: {
         productCode: '', //  产品编码
         productName: '', //  产品名称
@@ -277,12 +280,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' },
@@ -302,6 +308,7 @@ export default {
       ]
       return arr
     },
+    // 全部产品列定义
     columns1 () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -318,6 +325,7 @@ export default {
     }
   },
   methods: {
+    // 关闭销售记录弹框
     cansel () {
       this.isShow = false
     },
@@ -330,13 +338,13 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
-    //  产品分类  change
+    //  产品分类选择
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    // 添加
+    // 添加产品
     handleAdd (row) {
       const clist = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
       const blist = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys || []
@@ -351,7 +359,7 @@ export default {
       }
       this.$emit('add', row)
     },
-    // 批量添加
+    // 批量添加产品
     handlePlAdd () {
       if (this.selectTotal) {
         this.$emit('plAdd', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || [])
@@ -359,6 +367,7 @@ export default {
         this.$message.info('请选择产品')
       }
     },
+    // 重置列表
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -371,17 +380,19 @@ export default {
       this.$refs.table.clearSelected()
       this.$refs.table.refresh(true)
     },
+    // 加载完成后,重新查询列表
     reload () {
       this.$refs.table.clearSelected()
       this.$refs.table.refresh()
     },
     // ---------- 全部产品----------
-    //  产品分类  change
+    //  产品分类查询
     changeProductType1 (val, opt) {
       this.queryParam1.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam1.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam1.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 重置列表
     resetSearchForm1 () {
       this.queryParam1.productCode = ''
       this.queryParam1.productName = ''

+ 24 - 10
src/views/salesManagement/salesQuery/detail.vue

@@ -112,7 +112,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="'salesQuery-cost-'+record.productSn"
+              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>
@@ -126,12 +132,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 '@/views/common/outInDetialModal.vue'
 import Print from '@/views/common/print.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, Print, outInDetialModal },
@@ -144,13 +152,13 @@ export default {
   },
   data () {
     return {
-      showPage: false,
-      spinning: false,
-      disabled: false,
-      showCost: false,
+      showPage: false, // 是否显示组件
+      spinning: false, // 加载动画
+      disabled: false, // 禁用按钮
+      showCost: false, // 是否显示成本价
       printOrgCode: false, // 打印原创编码
       printAllName: false, // 打印全部名称
-      showOutInModal: false,
+      showOutInModal: false, // 出库弹框
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -180,7 +188,7 @@ export default {
           return data
         })
       },
-      localDataSource: [],
+      localDataSource: [], // 原始列表数据
       detailData: null //  详情数据
     }
   },
@@ -193,6 +201,7 @@ export default {
     isAudit () {
       return this.detailData ? (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH') : false
     },
+    // 列字段
     columns () {
       const _this = this
       const arr = [
@@ -267,6 +276,7 @@ export default {
       this.showOutInModal = true
       this.$refs.outInDetialModal.getData(row)
     },
+    // 页面初始化
     pageInit () {
       const vm = this
       vm.$nextTick(() => {
@@ -275,15 +285,19 @@ export default {
         // 是否默认打印原厂编码
         vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
         vm.printAllName = localStorage.getItem('printAllName-' + 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)
     },
+    // 是否默认打印所有名称
     printAllName (newValue, oldValue) {
       localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
     }

+ 55 - 43
src/views/salesManagement/salesQuery/edit.vue

@@ -17,9 +17,9 @@
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra" v-if="$hasPermissions('B_salesPrint')">
-          <a-checkbox v-model="printAllName" :checked="printAllName" id="salesQuery-printAllName">打印完整产品名称</a-checkbox>
-          <a-checkbox v-model="printOrgCode" :checked="printOrgCode" id="salesQuery-printOrgCode">打印原厂编码</a-checkbox>
-          <Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
+          <a-checkbox v-model="printAllName" :checked="printAllName" id="salesEdit-printAllName">打印完整产品名称</a-checkbox>
+          <a-checkbox v-model="printOrgCode" :checked="printOrgCode" id="salesEdit-printOrgCode">打印原厂编码</a-checkbox>
+          <Print id="salesEdit-printBox" :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesEdit-cont">
@@ -48,13 +48,13 @@
               <div>
                 折扣金额:
                 <a-input-number
-                  id="discount"
+                  id="salesEdit-discount-input"
                   size="small"
                   v-model.trim="detailData.discountAmount"
                   :min="0"
                   :precision="2"
                   :max="999999"/>
-                <a-button size="small" type="primary" class="button-primary" @click="salesDiscount">打折</a-button>
+                <a-button id="salesEdit-discount-button" size="small" type="primary" class="button-primary" @click="salesDiscount">打折</a-button>
               </div>
               <div>
                 折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
@@ -71,12 +71,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="salesEdit-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="salesEdit-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
                     </a-form-model-item>
                   </a-col>
                   <a-col :md="8" :sm="24">
@@ -90,16 +90,16 @@
             </a-col>
             <a-col :md="24" :lg="12">
               <div style="float:right;overflow: hidden;margin-bottom:10px;">
-                <a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesQuery-tbsh">同步审核</a-checkbox>
-                <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox>
-                <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox>
+                <a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesEdit-tbsh">同步审核</a-checkbox>
+                <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesEdit-tbck">同步出库</a-checkbox>
+                <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesEdit-tbsk">同步收款</a-checkbox>
                 <a-button
                   style="padding: 0 25px;"
                   type="primary"
                   :disabled="spinning"
                   class="button-primary"
                   @click="enableFundAccount && tbForm.length == 3 ? handleSettleAcountPay(null,0) : handleSubmit({})"
-                  id="productInfoList-handleSubmit">提交</a-button>
+                  id="salesEdit-handleSubmit">提交</a-button>
                 <a-button
                   type="default"
                   @click="openGuideModal=true"
@@ -170,7 +170,7 @@
           <!-- 售价 -->
           <template slot="price" slot-scope="text, record">
             <a-input-number
-              id="salesEdit-price"
+              :id="'salesEdit-price-'+record.productSn"
               size="small"
               v-model="record.price"
               :precision="2"
@@ -183,7 +183,7 @@
           <!-- 销售数量 -->
           <template slot="salesNums" slot-scope="text, record">
             <a-input-number
-              id="salesEdit-salesNums"
+              :id="'salesEdit-salesNums-'+record.productSn"
               size="small"
               v-model="record.qty"
               :precision="0"
@@ -195,19 +195,24 @@
           </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-outDetail-'+record.productSn"
+              size="small"
+              v-if="record.oosFlag == 0 && isOwerEdit"
+              type="link"
+              class="button-primary"
+              @click="handleViewDetail(record)">出库明细</a-button>
+            <a-button
+              :id="'salesEdit-del-'+record.productSn"
               size="small"
               type="link"
               :loading="delLoading"
               class="button-error"
-              @click="handleDel(record)"
-              id="productInfoList-Del">删除</a-button>
+              @click="handleDel(record)">删除</a-button>
           </template>
         </s-table>
       </a-card>
     </a-spin>
-    <!-- <div class="affix-cont"></div> -->
     <!-- 选择客户弹框 -->
     <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
     <!-- 导入产品 -->
@@ -230,19 +235,22 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { mapActions } from 'vuex'
+import Print from '@/views/common/print.vue'
+import { hdPrint } from '@/libs/JGPrint'
+// 组件
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import importGuideModal from './importGuideModal.vue'
 import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
+import outInDetialModal from '@/views/common/outInDetialModal.vue'
+import chooseShelfProduct from './chooseShelfProduct.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 } from '@/api/salesDetail'
-import outInDetialModal from '@/views/common/outInDetialModal.vue'
-import chooseShelfProduct from './chooseShelfProduct.vue'
-import Print from '@/views/common/print.vue'
-import { hdPrint } from '@/libs/JGPrint'
+import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailInsertImport } from '@/api/salesDetail'
+
 export default {
   name: 'SalesEdit',
   components: { STable, VSelect, queryPart, chooseCustomModal, Print, importGuideModal, settleModal, outInDetialModal, chooseShelfProduct },
@@ -250,8 +258,8 @@ export default {
   data () {
     return {
       showOutInModal: false, // 出入库明细
-      showPage: false,
-      spinning: false,
+      showPage: false, // 是否显示当前页面
+      spinning: false, // loading
       orderId: null, // 销售单id
       salesBillSn: null, // 销售单sn
       disabled: false, //  查询、重置按钮是否可操作
@@ -261,13 +269,13 @@ export default {
       openSettleModal: false, // 打开收款弹框
       enableFundAccount: false, // 是否开启资金账户管理
       showShelfModal: false, // 货架产品弹框
-      delLoading: false,
+      delLoading: false, // 删除按钮loading
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
-      dataSource: [],
-      productForm: {
-        productName: '',
-        productCode: '',
-        orderBy: 'sales_bill_detail.CREATE_DATE desc'
+      dataSource: [], // 原始列表数据
+      productForm: { // 查询条件
+        productName: '', // 产品名称
+        productCode: '', // 产品编码
+        orderBy: 'sales_bill_detail.CREATE_DATE desc' // 排序
       },
       tbForm: [], // 同步操作
       printOrgCode: false, // 打印原创编码
@@ -306,6 +314,7 @@ export default {
     isAudit () {
       return this.detailData && (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH')
     },
+    // 列定义
     columns () {
       const _this = this
       const arr = [
@@ -339,6 +348,10 @@ export default {
   },
   methods: {
     ...mapActions(['GetSettleAccountState']),
+    //  返回列表
+    handleBack () {
+      this.$router.push({ path: '/salesManagement/salesQuery/list' })
+    },
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
@@ -353,6 +366,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 选择同步选框
     tbFormChange (e, val) {
       this.tbForm = []
       const tbTypes = ['AUDIT', 'STOCK_OUT', 'SETTLE']
@@ -466,6 +480,7 @@ export default {
         record.price = record.priceBackups
       }
     },
+    // 成本显示
     isCost (val) {
       this.isCosts = val
     },
@@ -484,10 +499,6 @@ export default {
       }
       this.$refs.table.refresh()
     },
-    //  返回
-    handleBack () {
-      this.$router.push({ path: '/salesManagement/salesQuery/list' })
-    },
     // 打折
     salesDiscount () {
       this.spinning = true
@@ -594,7 +605,6 @@ export default {
     saveNewProduct (row) {
       this.$message.loading('正在添加产品...', 1)
       this.isInster = true
-      // this.spinning = true
       salesDetailInsert({
         buyerSn: this.detailData.buyerSn,
         productSn: row.productSn,
@@ -629,7 +639,6 @@ export default {
           }
         }
         this.isInster = false
-        // this.spinning = false
       })
     },
     // 批量添加接口
@@ -666,8 +675,9 @@ export default {
           this.detailData = res.data
           if (flag) {
             const vm = this
+            // 客户sn
             const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
-            const priceType = vm.$route.params.priceType
+            const priceType = vm.$route.params.priceType // 价格类型
             vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn)
             // 查询关联的客户
             if (vm.detailData && vm.detailData.buyerSn) {
@@ -677,6 +687,7 @@ export default {
         }
       })
     },
+    // 查询关联的客户,获取货架信息
     getShelfQueryByCustomer () {
       queryByCustomerSn({ sn: this.detailData.buyerSn }).then(res => {
         if (res.data) {
@@ -689,16 +700,13 @@ export default {
     // 提交销售单
     handleSubmit (params) {
       this.spinning = true
-      const submitTypes = this.tbForm.join(',')
+      const submitTypes = this.tbForm.join(',') // 同步操作选项
       salesWriteSubmit({ id: this.orderId, submitTypes: submitTypes, ...params }).then(res => {
-        console.log(res)
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)
-          // this.spinning = false
-        } else {
-          this.spinning = false
         }
+        this.spinning = false
       })
     },
     // 开启结算账户功能收款, type:0 单条收款,1 批量收款
@@ -737,6 +745,7 @@ export default {
         this.spinning = false
       })
     },
+    // 页面初始化
     pageInit () {
       const vm = this
       vm.$nextTick(() => {
@@ -745,15 +754,18 @@ export default {
         // 是否默认打印原厂编码
         vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
         vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
+        // 获取销售单详情
         vm.getOrderDetail(true)
         vm.$refs.table.refresh(true)
       })
     }
   },
   watch: {
+    // 是否打印产品原厂编码
     printOrgCode (newValue, oldValue) {
       localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
     },
+    // 是否打印产品全名称
     printAllName (newValue, oldValue) {
       localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
     }
@@ -774,7 +786,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
     	  }
     	})
     }

+ 7 - 7
src/views/salesManagement/salesQuery/importGuideModal.vue

@@ -18,7 +18,7 @@
             <li>1) 导入的Excel文件中必须包含名为“产品编码”、“仓库”、“仓位”、“售价”、“数量”的列,且名称必须相同,其它列可自定义,不影响数据导入</li>
             <li>2) 如果导入的产品已经存在,则不会导入该行</li>
             <li>
-              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+              <a :href="filePath" style="margin: 5px 0 0;display: block;" id="sales-import-tpl">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板
               </a>
             </li>
@@ -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: {
     //  父页面传过来的弹框状态

+ 1 - 0
src/views/salesManagement/salesQuery/list.vue

@@ -263,6 +263,7 @@ import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { downloadExcel } from '@/libs/JGPrint.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import auditModal from '@/views/common/auditModal.vue'

+ 18 - 14
src/views/salesManagement/salesQuery/productSalesRecordModal.vue

@@ -15,10 +15,10 @@
           <div>产品编码:{{ baseData.productCode }}</div>
           <div>产品名称:{{ baseData.productName }}</div>
         </div>
-        <a-tabs size="small" type="card" v-model="curTab" @change="callback">
-          <a-tab-pane key="1" tab="当前客户">
+        <a-tabs size="small" type="card" id="sales-record-tab" v-model="curTab" @change="callback">
+          <a-tab-pane key="1" tab="当前客户" id="sales-record-tab-1">
           </a-tab-pane>
-          <a-tab-pane key="2" tab="全部客户">
+          <a-tab-pane key="2" tab="全部客户" id="sales-record-tab-2">
           </a-tab-pane>
         </a-tabs>
         <!-- 表格 -->
@@ -35,6 +35,7 @@
         </a-table>
         <!-- 分页 -->
         <tablePagination
+          id="sales-record-pagination"
           ref="tablePagination"
           :total="paginationProps.total"
           :current="paginationProps.current"
@@ -49,6 +50,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { salesRecordlList } from '@/api/salesDetail.js'
+// 组件
 import { STable } from '@/components'
 import tablePagination from '@/views/common/tablePagination.vue'
 export default {
@@ -60,7 +62,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemId: { // 单据id
       type: [Number, String],
       default: ''
     }
@@ -74,9 +76,9 @@ export default {
     const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
-      buyerSn: null,
+      buyerSn: null, // 客户sn
       queryParam: {
-        productSn: null
+        productSn: null // 产品sn
       },
       // 表头
       columns: [
@@ -85,19 +87,19 @@ 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: [],
-      loading: false,
-      curTab: '1',
+      list: [], // 列表数据
+      loading: false, // 加载动画
+      curTab: '1', // 页签值
       paginationProps: {
         total: 0, //  分页总条数
-        current: 1,
-        pageSize: 20
+        current: 1, // 当前页
+        pageSize: 20 // 每页数量
       },
-      baseData: null
+      baseData: null // 单据基础信息
     }
   },
   methods: {
-    //  获取详情
+    //  获取详情数据,客户,产品sn,单据信息
     getDetail (buyerSn, productSn, row) {
       this.buyerSn = buyerSn
       if (this.curTab == 1) {
@@ -109,7 +111,7 @@ export default {
       this.handelSearch(1)
       this.baseData = row
     },
-    // 查询列表
+    // 销售记录查询列表
     handelSearch (pageNo) {
       this.paginationProps.current = pageNo || this.paginationProps.current
       const params = {
@@ -144,6 +146,7 @@ export default {
       this.paginationProps.current = current
       this.handelSearch()
     },
+    // 改变页签时调用
     callback (key) {
       this.curTab = key
       this.getDetail(this.buyerSn, this.queryParam.productSn, this.baseData)
@@ -158,6 +161,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置页面数据
         this.paginationProps.total = 0
         this.paginationProps.current = 1
         this.paginationProps.pageSize = 20

+ 73 - 51
src/views/salesManagement/salesQuery/queryPart.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="productInfoList-wrap">
+  <div class="partQuery-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
       <a-form-model
@@ -12,35 +12,35 @@
         <a-row type="flex" :gutter="5">
           <a-col :lg="4" :md="6" :sm="12">
             <a-form-model-item label="产品编码">
-              <a-input id="productInfoList-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              <a-input id="partQuery-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-model-item>
           </a-col>
           <a-col :lg="4" :md="6" :sm="12">
             <a-form-model-item label="产品名称">
-              <a-input id="productInfoList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="partQuery-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-model-item>
           </a-col>
           <a-col :lg="4" :md="6" :sm="12">
             <a-form-model-item label="原厂编码">
-              <a-input id="productInfoList-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+              <a-input id="partQuery-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
             </a-form-model-item>
           </a-col>
           <a-col :lg="4" :md="6" :sm="12">
             <a-form-model-item label="产品分类">
-              <ProductType id="productInfoList-productType" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+              <ProductType id="partQuery-productType" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
             </a-form-model-item>
           </a-col>
           <template v-if="advanced">
             <a-col :lg="4" :md="6" :sm="12">
               <a-form-model-item label="产品品牌">
-                <ProductBrand id="productInfoList-productBrandSn" v-model="queryParam.brandSn"></ProductBrand>
+                <ProductBrand id="partQuery-productBrandSn" v-model="queryParam.brandSn"></ProductBrand>
               </a-form-model-item>
             </a-col>
             <a-col :lg="4" :md="6" :sm="12">
               <a-form-model-item label="仓库">
                 <a-select
                   placeholder="请选择仓库"
-                  id="productInfoList-warehouseSn"
+                  id="partQuery-warehouseSn"
                   allowClear
                   v-model="queryParam.warehouseSn"
                   :showSearch="true"
@@ -52,15 +52,15 @@
             </a-col>
             <a-col :lg="6" :md="8" :sm="12" v-if="$hasPermissions('B_salerVinFindProduct')">
               <a-form-model-item label="车架号(VIN)" prop="vinCode">
-                <a-input id="productInfoList-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
+                <a-input id="partQuery-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
                   <a-icon @click="uploadFun" :type="vinLoading?'loading':'camera'" slot="addonAfter" :style="{ fontSize: '18px', verticalAlign: 'bottom' }" />
                 </a-input>
-                <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
+                <input type="file" id="partQuery-filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="是否有库存">
-                <a-select @change="handleHasQty" allowClear :value="queryParam.existStockFlag" placeholder="请选择查看是否有库存">
+                <a-select @change="handleHasQty" id="partQuery-existStockFlag" allowClear :value="queryParam.existStockFlag" placeholder="请选择查看是否有库存">
                   <a-select-option value="1">
                   </a-select-option>
@@ -72,9 +72,9 @@
             </a-col>
           </template>
           <a-col flex="200px" 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" id="productInfoList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin:0 0 0 10px">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="partQuery-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" id="partQuery-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin:0 0 0 10px" id="partQuery-advanced">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
@@ -91,9 +91,9 @@
     <a-alert type="error" style="margin-bottom: 10px;" v-if="vinInfoData&&!vinInfoData.vinInfo">
       <template slot="message"><a-icon type="exclamation-circle" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!</template>
     </a-alert>
-    <a-alert type="warning" style="margin-bottom: 10px;cursor: pointer;" v-if="vinInfoData&&vinInfoData.vinInfo" @click="openCarInfoModal=true">
+    <a-alert type="warning" style="margin-bottom: 10px;cursor: pointer;" id="partQuery-alert" v-if="vinInfoData&&vinInfoData.vinInfo" @click="openCarInfoModal=true">
       <template slot="message">
-        <div style="display: flex;justify-content: space-between;align-items: center;" @click="openCarInfoModal=true">
+        <div id="partQuery-openCarInfoModal" style="display: flex;justify-content: space-between;align-items: center;" @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>
@@ -132,6 +132,7 @@
           <a-input-number
             size="small"
             v-model="record.price"
+            :id="'partQuery-price-'+record.productSn"
             :precision="2"
             :min="0"
             :max="999999"
@@ -146,6 +147,7 @@
         <div @dblclick.stop>
           <a-input-number
             size="small"
+            :id="'partQuery-salesNums-'+record.productSn"
             v-model="record.salesNums"
             :precision="0"
             :min="0"
@@ -161,13 +163,13 @@
           type="link"
           class="button-primary"
           @click="handleAdd(record)"
-          id="productInfoList-edit-btn">添加</a-button>
+          id="partQuery-edit-btn">添加</a-button>
         <a-button
           size="small"
           type="link"
           class="button-primary"
           @click="handleDetail(record)"
-          id="productInfoList-detail-btn"
+          id="partQuery-detail-btn"
           style="margin-left: 5px;">销售记录</a-button>
       </template>
     </s-table>
@@ -180,15 +182,17 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { querySumByProductLocation } from '@/api/stock'
-import { warehouseAllList } from '@/api/warehouse'
-import productSalesRecordModal from './productSalesRecordModal.vue'
-import carInfoModal from './carInfoModal.vue'
-import ProductType from '../../common/productType.js'
-import ProductBrand from '../../common/productBrand.js'
+import defImg from '@/assets/def_img@2x.png'
+// 组件
 import { STable, VSelect, Upload } from '@/components'
+import productSalesRecordModal from './productSalesRecordModal.vue' // 产品销售记录弹框
+import carInfoModal from './carInfoModal.vue' // 车型信息弹框
+import ProductType from '../../common/productType.js' // 产品分类下拉
+import ProductBrand from '../../common/productBrand.js' // 产品品牌下拉
+// 接口
 import { supperCodeByVin, vinCodeParse } from '@/api/sales'
-import defImg from '@/assets/def_img@2x.png'
+import { querySumByProductLocation } from '@/api/stock'
+import { warehouseAllList } from '@/api/warehouse'
 export default {
   name: 'QueryPart',
   components: { STable, VSelect, Upload, productSalesRecordModal, carInfoModal, ProductType, ProductBrand },
@@ -199,54 +203,59 @@ export default {
   data () {
     return {
       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: '',
-      rules: {
+      priceType: '', // 价格类型
+      buyerSn: '', // 客户sn
+      rules: { // 校验
         vinCode: [ { len: 17, message: '请输入正确的车架号(VIN)', trigger: 'change' } ]
       },
       disabled: false, //  查询、重置按钮是否可操作
       warehouseList: [], // 仓库列表
-      vinInfoData: null,
+      vinInfoData: null, // 车辆信息
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         const _this = this
+        // 价格类型
         _this.queryParam.salePriceType = _this.priceType
+        // 客户sn
         _this.queryParam.customerSn = _this.buyerSn
-        // 排序
+        // 产品编码排序
         if (parameter.sortField == 'productCode') {
           parameter.sortField = 'code'
           parameter.sortAlias = 'product '
         }
+        // 产品品牌名称排序
         if (parameter.sortField == 'brandName') {
           parameter.sortField = 'firstChar'
           parameter.sortAlias = 'brand'
         }
+        // 仓库排序
         if (parameter.sortField == 'warehouseName') {
           parameter.sortField = 'warehouseSn'
           parameter.sortAlias = 'sd'
         }
         const params = Object.assign(parameter, _this.queryParam)
-        if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17 && !this.onlyList) { //  输入vin,查出vin码信息后请求列表数据
+        //  输入vin,查出vin码信息后请求列表数据
+        if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17 && !this.onlyList) {
           _this.disabled = true
           return supperCodeByVin({ vin: _this.queryParam.vinCode }).then(res => {
             if (res.status == 200) {
@@ -259,11 +268,14 @@ export default {
               _this.$refs.table.clearTable()
             }
           })
-        } else if (_this.queryParam.vinCode && _this.queryParam.vinCode.length < 17 && !this.onlyList) { // 输入vin,但vin码不符合标准,不查vin码信息,不请求列表数据
+          // 输入vin,但vin码不符合标准,不查vin码信息,不请求列表数据
+        } else if (_this.queryParam.vinCode && _this.queryParam.vinCode.length < 17 && !this.onlyList) {
           _this.$refs.table.localLoading = false
           _this.$refs.table.clearTable()
+          // 清空查询条件
         } else if (this.onlyList) {
           _this.disabled = true
+          // ,按车型查询
           if (_this.queryParam.vinCode && _this.vinInfoData) {
             return _this.getList(Object.assign(params, { productCodeList: _this.vinInfoData.partCodeList }))
           } else {
@@ -279,8 +291,8 @@ export default {
       cityPrice: false, // 城市价
       tyuePrice: false, // 特约价
       zdPrice: false, // 终端价
-      openCarInfoModal: false,
-      onlyList: false
+      openCarInfoModal: false, // 车型弹框
+      onlyList: false // 是否情况查询条件
     }
   },
   computed: {
@@ -295,6 +307,7 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
+      // 成本价权限
       if (this.cost) {
         arr.push({ slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
@@ -324,6 +337,7 @@ export default {
     }
   },
   methods: {
+    // 查询产品列表
     getList (params) {
       const _this = this
       return querySumByProductLocation(params).then(res => {
@@ -336,8 +350,10 @@ export default {
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].salesNums = 1
-            data.list[i].currentQty = data.list[i].currentQty || 0
+            data.list[i].currentQty = data.list[i].currentQty || 0 // 库存数量
+            // 价格
             data.list[i].price = data.list[i].origSalePriceFlag == 0 ? data.list[i].lastSalePrice : data.list[i].origSalePriceFlag == 1 ? data.list[i].salePrice : data.list[i].selfSaleprice
+            // 原厂编码
             data.list[i].productOrigCode = data.list[i].productOrigCode ? data.list[i].productOrigCode.trim() : ''
           }
           if (!params.vinCode) {
@@ -351,11 +367,10 @@ export default {
           }
         }
         _this.disabled = false
-        console.log(data)
         return data
       })
     },
-    // vin  change
+    // 车型vin码变更时
     vinCodeChange (e) {
       if (e.target.value.length == 17) {
         supperCodeByVin({ vin: e.target.value }).then(res => {
@@ -373,7 +388,7 @@ export default {
     handleClickRow (record) {
       this.$emit('add', record)
     },
-    //  重置
+    //  重置列表
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -391,6 +406,7 @@ export default {
       this.$refs.table.refresh(true)
       this.vinInfoData = null
     },
+    // 初始页面
     pageInit (buyerSn, priceType, salesBillSn) {
       this.priceType = priceType || ''
       this.buyerSn = buyerSn || ''
@@ -412,6 +428,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 仓库按名称筛选
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -420,7 +437,8 @@ export default {
     // 选择配件
     handleAdd (row) {
       const _this = this
-      console.log(row.price, row.lastSalePrice, row.salePrice, row.lastSalePrice < row.salePrice)
+      // console.log(row.price, row.lastSalePrice, row.salePrice, row.lastSalePrice < row.salePrice)
+      // 售价低于定价
       if (row.lastSalePrice && (row.price < row.salePrice)) {
         _this.$confirm({
           title: '提示',
@@ -440,13 +458,15 @@ export default {
       this.openModal = true
       this.$refs.salseRecord.getDetail(this.buyerSn, row.productSn, row)
     },
-    //  关闭弹框
+    //  关闭销售记录弹框
     closeModal () {
       this.openModal = false
     },
+    // 上传图片
     uploadFun () {
-      document.getElementById('filed').click()
+      document.getElementById('partQuery-filed').click()
     },
+    // 文件上传后
     filePreview (e) {
       const _this = this
       var files = e.target.files[0]
@@ -454,6 +474,7 @@ export default {
       formData.append('savePathType', 'local')
       formData.append('file', files)
       this.vinLoading = true
+      // 识别图片中的vin
       vinCodeParse(formData).then(res => {
         if (res.type == 'application/json') {
           var reader = new FileReader()
@@ -478,7 +499,7 @@ export default {
         }
       })
     },
-    // 仓库
+    // 仓库变更
     getWarehouse () {
       warehouseAllList({ wasteFlag: 0 }).then(res => {
         if (res.status == 200) {
@@ -488,7 +509,7 @@ export default {
         }
       })
     },
-    //  产品分类  change
+    //  产品分类变更
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
@@ -500,6 +521,7 @@ export default {
     }
   },
   watch: {
+    // 成本显示变化
     cost (newValue, oldValue) {
       this.$emit('isCost', newValue)
     }