lilei 1 jaar geleden
bovenliggende
commit
f77273b274

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

@@ -63,16 +63,18 @@ export default {
     return {
       opened: this.show,
       spinning: false,
-      title: '选择客户',
-      confirmLoading: false,
+      title: '选择客户', // 弹框标题
+      confirmLoading: false, // loading
+      // 表单列
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 表单数据
       form: {
         buyerSn: undefined, // 客户sn
-        buyerName: '',
-        settleStyleSn: undefined,
+        buyerName: '', // 客户名称
+        settleStyleSn: undefined, // 支付方式
         shippingAddrProvinceSn: '',
         shippingAddrProvinceName: '', // 省
         shippingAddrCitySn: '',
@@ -82,8 +84,9 @@ export default {
         shippingAddr: '', // 详细地址
         consigneeTel: '', // 联系电话
         consigneeName: '', // 联系人名称
-        warehouseSn: undefined
+        warehouseSn: undefined // 仓库
       },
+      // 表单校验规则
       rules: {
         buyerSn: [ { required: true, message: '请选择客户', trigger: ['change', 'blur'] } ],
         settleStyleSn: [ { required: true, message: '请选择支付方式', trigger: ['change', 'blur'] } ],
@@ -95,8 +98,7 @@ export default {
     }
   },
   methods: {
-
-    // 客户 change
+    // 选择客户 change
     custChange (val) {
       if (val && val.key) {
         this.form.buyerSn = val.key || undefined
@@ -113,11 +115,11 @@ export default {
         this.verifyFun(this.addressId)
       }
     },
-    //  选择地址
+    // 打开选择地址弹框
     handleChoose () {
       this.openAddrModal = true
     },
-    //  保存
+    // 保存
     handleSubmit (e) {
       e.preventDefault()
       const _this = this
@@ -125,7 +127,6 @@ export default {
         if (valid) {
           _this.salesSaveFun()
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -149,12 +150,13 @@ export default {
         }
       })
     },
+    // 关闭弹框
     cancel () {
       this.opened = false
       this.$emit('cancel')
       this.$refs.ruleForm.resetFields()
     },
-    //  地址保存
+    // 地址保存
     handleOk (data) {
       this.chooseAddr = (data.consigneeName || '') + '(' + (data.consigneeTel || '-') + ')' + ' ' + (data.address || '')
       this.addressVal = '更换地址'
@@ -172,6 +174,7 @@ export default {
       // 移除表单项的校验结果
       this.$refs.ruleForm.clearValidate('consigneeTel')
     },
+    // 重置地址
     verifyFun (id) {
       if (id == this.addressId) {
         this.chooseAddr = ''

+ 17 - 13
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -47,6 +47,7 @@
         </a-row>
       </a-form>
     </div>
+    <!-- tab选项卡 -->
     <a-tabs type="card" @change="changeTab">
       <a-tab-pane v-for="item in tabList" :key="item.val" :tab="item.text"></a-tab-pane>
     </a-tabs>
@@ -126,8 +127,8 @@ export default {
     return {
       advanced: false, // 高级搜索 展开/关闭
       showSetting: false, // 设置弹框
-      productType: [],
-      buyerSn: '',
+      productType: [], // 产品类型
+      buyerSn: '', // 客户sn
       queryParam: { //  查询条件
         productCode: '', //  产品编码
         productName: '', //  产品名称
@@ -136,14 +137,14 @@ export default {
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        warehouseSn: undefined
+        warehouseSn: undefined // 仓库sn
       },
       defaultWarehouseSn: undefined, // 默认仓库sn
-      tableHeight: 300,
+      tableHeight: 300, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
-      promoProductClz: 'GATE',
-      promoRuleData: null,
-      tabList: [],
+      promoProductClz: 'GATE', // 促销产品类型
+      promoRuleData: null, // 促销规则数据
+      tabList: [], // 促销产品选项卡
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -158,7 +159,9 @@ 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].currentStockQty = data.list[i].currentStockQty || 0
+              // 产品包装数
               const productPackQty = (data.list[i].productPackQty || data.list[i].productPackQty == 0) ? data.list[i].productPackQty : '--'
               const productUnit = data.list[i].productUnit || '--'
               const productPackQtyUnit = data.list[i].productPackQtyUnit || '--'
@@ -208,6 +211,7 @@ export default {
     }
   },
   methods: {
+    // 加载仓库
     loadWarehouse (sn) {
       this.defaultWarehouseSn = sn
       this.queryParam.warehouseSn = sn
@@ -220,7 +224,7 @@ export default {
       this.promoProductClz = e
       this.resetSearchForm()
     },
-    // 双击列表
+    // 双击列表添加产品
     handleClickRow (record) {
       const _this = this
       return {
@@ -239,7 +243,7 @@ export default {
         this.$message.info('请选择仓库')
       }
     },
-    //  重置
+    // 重置
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -252,6 +256,7 @@ export default {
       this.queryParam.warehouseSn = this.defaultWarehouseSn
       this.$refs.table.refresh(true)
     },
+    // 页面初始化
     pageInit (data, promo) {
       this.buyerSn = data.buyerSn
       this.promoRuleData = promo.promotionRule
@@ -263,7 +268,7 @@ export default {
       const isMcpScp = this.promoRuleData && this.promoRuleData.convertExpenseFlag == 1 && this.promoRuleData.promotionRuleType == 'BUY_PROD_GIVE_PROD'
       // 是否卖产品送采购额
       const isMcpScge = this.promoRuleData.promotionRuleType == 'BUY_PROD_GIVE_MONEY' && this.promoRuleData.scopeFlag === '1'
-
+      // 选项卡数据
       const tabList = []
       if (this.promoRuleData) {
         if (this.promoRuleData.gateFlag === '1') {
@@ -283,7 +288,6 @@ export default {
       this.tabList = tabList
       this.promoProductClz = tabList[0].val
       this.tableHeight = window.innerHeight - 330
-
       this.queryParam.scopeLevel = promo.countData.scopeLevel
       this.resetSearchForm()
     },
@@ -294,11 +298,11 @@ export default {
         _this.$refs.table.refresh()
       })
     },
-    // 选择配件
+    // 添加产品
     handleAdd (row) {
       this.$emit('add', row, 0, this.promoProductClz)
     },
-    //  产品分类  change
+    // 选择产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''

+ 8 - 4
src/views/salesManagement/salesQueryNew/comps/chooseImportModal.vue

@@ -23,6 +23,7 @@
         :pagination="false"
         bordered>
       </a-table>
+      <!-- 分割线 -->
       <a-divider />
       <!-- 不可导入数据 -->
       <p class="red">不可导入数据{{ unLoadData.length }}条</p>
@@ -77,7 +78,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: Object,
       default: () => {
         return {}
@@ -87,6 +88,7 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 正常列
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -97,6 +99,7 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: '14%', align: 'center', 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 || '--' } },
@@ -112,11 +115,12 @@ export default {
     }
   },
   methods: {
+    // 获取数据,并格式化
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
-      console.log(paramsData)
-      this.loadData = paramsData.rightList || []
-      this.unLoadData = paramsData.errorList || []
+      this.loadData = paramsData.rightList || [] // 可导入数据
+      this.unLoadData = paramsData.errorList || [] // 错误数据
+      // 格式化序号
       this.loadData.map((item, index) => {
         item.no = index + 1
       })

+ 22 - 19
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -10,15 +10,15 @@
     :headerStyle="{ padding: '10px' }"
     @close="onClose"
     wrapClassName="chooseProducts-modal">
-      <a-spin :spinning="spinning" tip="Loading...">
-        <div class="products-con">
-          <div>
-            <!-- 查询配件列表 -->
-            <queryPart v-if="cptype==0" ref="partQuery" :newLoading="isInster" @add="insterProduct"></queryPart>
-            <activeQueryPart v-if="cptype==1" ref="partQuery" :newLoading="isInster" @add="insterProduct"></activeQueryPart>
-          </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="products-con">
+        <div>
+          <!-- 查询配件列表 -->
+          <queryPart v-if="cptype==0" ref="partQuery" :newLoading="isInster" @add="insterProduct"></queryPart>
+          <activeQueryPart v-if="cptype==1" ref="partQuery" :newLoading="isInster" @add="insterProduct"></activeQueryPart>
         </div>
-      </a-spin>
+      </div>
+    </a-spin>
   </a-drawer>
 </template>
 
@@ -33,7 +33,7 @@ export default {
       type: Boolean,
       default: false
     },
-    chooseData: {
+    chooseData: { // 已选数据
       type: Array,
       default: () => {
         return []
@@ -43,33 +43,36 @@ export default {
       type: Boolean,
       default: false
     },
-    zIndex:{
-      type: [String,Number],
+    zIndex: { // 层级
+      type: [String, Number],
       default: 1000
     }
   },
   data () {
     return {
       spinning: false,
-      cptype: 3,
+      cptype: 3, // 组件类型
       isShow: this.openModal, //  是否打开弹框
-      orderData: null
+      orderData: null // 订单数据
     }
   },
-  
+
   methods: {
+    // 关闭弹框
     onClose () {
       this.$emit('close')
     },
-    // 添加产品
+    // 添加产品,
+    // row 产品信息, promotionFlag 是否促销产品, promoProductClz 促销产品类型
     insterProduct (row, promotionFlag, promoProductClz) {
       this.$emit('addProduct', row, promotionFlag, promoProductClz)
     },
-    pageInit(data, promo, type){
-      console.log(data, promo, type)
+    // 初始化数据,
+    // data 订单数据, promo 促销活动数据, type 组件类型
+    pageInit (data, promo, type) {
       this.cptype = type
       this.orderData = data
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.$refs.partQuery.pageInit(data, promo)
       })
     }
@@ -82,7 +85,7 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
-        this.$emit('close',this.cptype)
+        this.$emit('close', this.cptype)
         this.cptype = 3
       }
     }

+ 405 - 381
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -1,397 +1,421 @@
 <template>
-    <!-- 已选配件列表 -->
-    <a-spin :spinning="spinning" tip="Loading...">
-          <ve-table
-            border-y
-            v-show="!showEmpty"
-            :scroll-width="0"
-            :max-height="tableHeight"
-            :show-header="showTableHead"
-            :row-style-option="{clickHighlight: true}"
-            :cellSelectionOption="{enable: false}"
-            :virtual-scroll-option="{enable: true}"
-            :columns="columns"
-            :table-data="dataSource"
-            row-key-field-name="id"
-            :cell-style-option="cellStyleOption"
-            :cell-span-option="cellSpanOption"
-            :column-width-resize-option="columnWidthResizeOption"
-          />
-        <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
-        <!-- 活动规则详情 -->
-        <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
-    </a-spin>
-  </template>
-  
-  <script>
-    import { commonMixin } from '@/utils/mixin'
-    import { Empty } from 'ant-design-vue';
-    import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
-    import { salesPromoQueryList } from '@/api/salesNew'
-    import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
-    export default {
-      name: 'DetailProductList',
-      mixins: [commonMixin],
-      components: { detailModal },
-      props: {
-        newLoading: Boolean,
-        detailData: {
-          type: Object,
-          default: function(){return null}
-        },
-        promo: {
-          type: Object,
-          default: function(){return null}
-        },
-        id: {
-          type: String,
-          default: ''
-        },
-        warehouseSn: {
-          type: String,
-          default: ''
-        },
-        promoFlag: {
-          type: String,
-          default: ''
-        },
-        salesBillSn: {
-          type: String,
-          default: ''
-        },
-        showCityPrice: {
-            type: Boolean,
-            default: false
-        },
-        authCode: {
-          type: String,
-          default: ''
-        },
-        maxHeight:{
-          type: [String,Number],
-          default: '300'
-        },
-        showHeader: {
-            type: Boolean,
-            default: true
+  <!-- 已选配件列表 -->
+  <a-spin :spinning="spinning" tip="Loading...">
+    <ve-table
+      border-y
+      v-show="!showEmpty"
+      :scroll-width="0"
+      :max-height="tableHeight"
+      :show-header="showTableHead"
+      :row-style-option="{clickHighlight: true}"
+      :cellSelectionOption="{enable: false}"
+      :virtual-scroll-option="{enable: true}"
+      :columns="columns"
+      :table-data="dataSource"
+      row-key-field-name="id"
+      :cell-style-option="cellStyleOption"
+      :cell-span-option="cellSpanOption"
+      :column-width-resize-option="columnWidthResizeOption"
+    />
+    <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
+    <!-- 活动规则详情 -->
+    <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
+  </a-spin>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { Empty } from 'ant-design-vue'
+import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
+import { salesPromoQueryList } from '@/api/salesNew'
+import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
+export default {
+  name: 'DetailProductList',
+  mixins: [commonMixin],
+  components: { detailModal },
+  props: {
+    newLoading: Boolean, // loading
+    detailData: { // 详情信息
+      type: Object,
+      default: function () { return null }
+    },
+    // 活动规则详情
+    promo: {
+      type: Object,
+      default: function () { return null }
+    },
+    // 表格id
+    id: {
+      type: String,
+      default: ''
+    },
+    // 仓库sn
+    warehouseSn: {
+      type: String,
+      default: ''
+    },
+    // 是否促销产品
+    promoFlag: {
+      type: String,
+      default: ''
+    },
+    // 销售单sn
+    salesBillSn: {
+      type: String,
+      default: ''
+    },
+    // 是否显示城市价格
+    showCityPrice: {
+      type: Boolean,
+      default: false
+    },
+    // 权限码
+    authCode: {
+      type: String,
+      default: ''
+    },
+    // 最大高度
+    maxHeight: {
+      type: [String, Number],
+      default: '300'
+    },
+    // 是否显示表格头部
+    showHeader: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      openDetailModal: false, // 活动规则详情弹框
+      detailSn: null, // 活动规则详情sn
+      activeList: [], // 活动列表
+      dataSource: [], // 列表原始数据
+      tableHeight: this.maxHeight, // 表格高度
+      // 自定义单元格样式
+      cellStyleOption: {
+        bodyCellClass: ({ row, column, rowIndex }) => {
+          if (row.id.indexOf('promo-') >= 0 && column.field === 'no') {
+            return 'table-body-cell-no'
+          }
         }
       },
-      data () {
-        return {
-          spinning: false,
-          openDetailModal: false,
-          detailSn: null,
-          activeList: [], // 活动列表
-          dataSource: [],
-          tableHeight: this.maxHeight,
-          cellStyleOption: {
-            bodyCellClass: ({ row, column, rowIndex }) => {
-                if (row.id.indexOf('promo-')>=0 && column.field === "no") {
-                    return "table-body-cell-no";
-                }
-            },
-          },
-          columnWidthResizeOption: {
-              // default false
-              enable: true,
-              // column resize min width
-              minWidth: 50
-          },
-          cellSpanOption: {
-              bodyCellSpan: this.bodyCellSpan,
-          },
-          isCityPrice: false,
-          outStockStr: '',
-          showEmpty: false,
-          showTableHead: true,
-          colspanNums: 13,
-          hasOutStockOfActive: false,
-          simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-        }
+      // 表格列可拖曳
+      columnWidthResizeOption: {
+        // default false
+        enable: true,
+        // column resize min width
+        minWidth: 50
       },
-      computed: {
-        columns () {
-          const _this = this
-          const priceFormat = function(data){
-            return _this.toThousands(data) || '--'
-          }
-          const numsFormat = function(data){
-            return data || data == 0 ? data : '--'
-          }
-          const codeFormat = function(record,data,h){
-            let ftext = ''
-            let fcolor = ''
-            if(record.promotionFlag == 'GIFT'){
-              ftext = '促'
-              fcolor = '#52c41a'
-            }
-            if(record.promotionFlag == 'GATE'){
-              ftext = '槛'
-              fcolor = '#108ee9'
-            }
-             
-            return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
-                        {record.convertPromoGiftsQty?(<a-badge count="转" number-style={{ backgroundColor: '#ffaa00', zoom:'80%' }}></a-badge>):''}
-                        {(Number(record.stockQty||0) < Number(record.unpushedQty||0)) && _this.showStock?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
-                    </div>
-                )
-          }
-          // 编号,并且格式化活动分类行
-          const noFormat = function(record,data,h){
-            const isBuyPSendP = record.promo && record.promo.promotionRule.convertExpenseFlag==1&&record.promo.promotionRule.promotionRuleType=='BUY_PROD_GIVE_PROD'
-            return (
-              <div>
-                {record.id.indexOf('promo-')>=0 ? (
-                  <div class="active-title">
-                    {record.promo?(
-                      <div>
-                        <strong style="font-size:14px;">{record.promo.promotion.description}</strong>
-                        <span>({record.promo.promotionRule.description})</span>
-                        <span style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={()=>_this.showDesc(record.promo)}>
-                          <a-icon title="查看活动详情" type="eye"/> 活动详情
-                        </span>
-                      </div>
-                    ):(<div></div>)}
-                    <div>
-                        款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
-                        数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
-                        {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount>0&&!isBuyPSendP ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount<0&&!isBuyPSendP ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.totalPromoGiftsAmount&&isBuyPSendP ? (<span>促销产品转采购额金额:<strong>{_this.toThousands(record.total.totalPromoGiftsAmount)}</strong>;</span>):('')}
-                        {record.total&&record.total.expenseAccountFlag!='WAIT' ? (<span style="color:red;">{record.total.expenseAccountFlagDictValue}</span>) : ''}
-                    </div>
+      // 自定义单元格内容
+      cellSpanOption: {
+        bodyCellSpan: this.bodyCellSpan
+      },
+      isCityPrice: false, // 是否显示市级价
+      outStockStr: '', // 产品库存不足提示信息
+      showEmpty: false, // 是否显示空数据图片
+      showTableHead: true, // 是否显示表格头部
+      colspanNums: 13, // 单元格合并列数
+      hasOutStockOfActive: false,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE // 空图片
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      // 价格单元格
+      const priceFormat = function (data) {
+        return _this.toThousands(data) || '--'
+      }
+      // 数字单元格
+      const numsFormat = function (data) {
+        return data || data == 0 ? data : '--'
+      }
+      // 销售单号
+      const codeFormat = function (record, data, h) {
+        let ftext = ''
+        let fcolor = ''
+        if (record.promotionFlag == 'GIFT') {
+          ftext = '促'
+          fcolor = '#52c41a'
+        }
+        if (record.promotionFlag == 'GATE') {
+          ftext = '槛'
+          fcolor = '#108ee9'
+        }
+
+        return (
+          <div>
+            <span style="padding-right: 15px;">{data}</span>
+            {ftext ? (<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom: '80%' }}></a-badge>) : ''}
+            {record.convertPromoGiftsQty ? (<a-badge count="转" number-style={{ backgroundColor: '#ffaa00', zoom: '80%' }}></a-badge>) : ''}
+            {(Number(record.stockQty || 0) < Number(record.unpushedQty || 0)) && _this.showStock ? (<a-badge count="缺" number-style={{ zoom: '80%' }}></a-badge>) : ''}
+          </div>
+        )
+      }
+      // 编号,并且格式化活动分类行
+      const noFormat = function (record, data, h) {
+        const isBuyPSendP = record.promo && record.promo.promotionRule.convertExpenseFlag == 1 && record.promo.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD'
+        return (
+          <div>
+            {record.id.indexOf('promo-') >= 0 ? (
+              <div class="active-title">
+                {record.promo ? (
+                  <div>
+                    <strong style="font-size:14px;">{record.promo.promotion.description}</strong>
+                    <span>({record.promo.promotionRule.description})</span>
+                    <span style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={() => _this.showDesc(record.promo)}>
+                      <a-icon title="查看活动详情" type="eye"/> 活动详情
+                    </span>
                   </div>
-                ):(<span>{data}</span>)}
+                ) : (<div></div>)}
+                <div>
+                  款数:<strong>{record.total && record.total.totalCategory || '--'}</strong>;
+                  数量:<strong>{record.total && record.total.totalQty || '--'}</strong>;
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total && record.total.totalAmount || '--'}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.cgejyAmount > 0 && !isBuyPSendP ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.cgejyAmount < 0 && !isBuyPSendP ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.totalPromoGiftsAmount && isBuyPSendP ? (<span>促销产品转采购额金额:<strong>{_this.toThousands(record.total.totalPromoGiftsAmount)}</strong>;</span>) : ('')}
+                  {record.total && record.total.expenseAccountFlag != 'WAIT' ? (<span style="color:red;">{record.total.expenseAccountFlagDictValue}</span>) : ''}
+                </div>
               </div>
-            )
+            ) : (<span>{data}</span>)}
+          </div>
+        )
+      }
+      // 显示折扣价
+      const discountPriceFormat = function (record, data, h) {
+        return (
+          <div>
+            {_this.toThousands(data)}
+            {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
+              <span title="原价">({ _this.toThousands(record.origPrice)})</span>
+            ) : ''}
+          </div>
+        )
+      }
+      // 列定义
+      let arr = [
+        { title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row, row[column.field], h) } },
+        { title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
+        { title: '产品名称', field: 'productName', key: 'c', width: 250, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
+      ]
+      // 计算可合并单元格数
+      this.colspanNums = this.showConvertPromoGifts ? 6 : 5
+      if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
+        this.colspanNums = this.colspanNums + 1
+        arr.push({ title: '成本价', field: 'showCost', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+      }
+      this.colspanNums = this.colspanNums + 2
+      arr = arr.concat([
+        { title: '单位', field: 'productOrigUnit', key: 'g', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '销售数量', field: 'qty', width: 80, key: 'h', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }
+      ])
+
+      if (this.$hasPermissions(this.authCode + '_provincePrice')) {
+        this.colspanNums = this.colspanNums + 1
+        arr.push({ title: '省级价', field: 'provincePrice', width: 80, key: 'i', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+      }
+      // 是否勾选市级价格
+      if (this.isCityPrice) {
+        this.colspanNums = this.colspanNums + 1
+        arr.push({ title: '市级价', field: 'cityPrice', width: 80, key: 'j', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+        if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
+          this.colspanNums = this.colspanNums + 1
+          arr.push({ title: '销售价', field: 'price', width: 100, key: 'k', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row, row[column.field], h) } })
+        }
+      } else {
+        if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
+          this.colspanNums = this.colspanNums + 1
+          arr.push({ title: '销售价', field: 'price', width: 100, key: 'l', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row, row[column.field], h) } })
+        }
+      }
+      //  审核,需用到库存
+      if (this.showStock) {
+        this.colspanNums = this.colspanNums + 1
+        arr.push({ title: '库存', field: 'stockQty', width: 80, key: 'm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+      }
+      this.colspanNums = this.colspanNums + 3
+      arr = arr.concat([
+        { title: '待下推数', field: 'unpushedQty', width: 80, key: 'o', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
+        { title: '已下推数', field: 'pushedQty', width: 80, key: 'p', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }
+      ])
+
+      // 如果有转采购额
+      if (this.showConvertPromoGifts) {
+        arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 100, key: 'z', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.convertPromoGiftsFlag ? numsFormat(row[column.field]) : '--' } })
+      }
+      arr.push({ title: '已取消数', field: 'cancelQty', width: 80, key: 'q', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+      return arr
+    },
+    // 是否有可转采购额
+    hasConvertPromoGifts () {
+      return this.detailData && this.detailData.totalConvertPromoGiftsQty
+    },
+    // 是否显示可转采购额
+    showConvertPromoGifts () {
+      return this.activeList && this.activeList.filter(item => item.enabledFlag == 1).find(item => item.promotionRule && item.promotionRule.convertExpenseFlag == 1 && item.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD')
+    },
+    // 是否显示库存列
+    showStock () {
+      return this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')
+    }
+  },
+  watch: {
+    // 是否显示城市价格变化时
+    showCityPrice (newValue, oldValue) {
+      this.isCityPrice = newValue
+    }
+  },
+  methods: {
+    // 关闭详情弹窗
+    closeDetailModal () {
+      this.detailSn = null
+      this.openDetailModal = false
+    },
+    // 合并活动分类单元格
+    bodyCellSpan ({ row, column, rowIndex }) {
+      if (row.id.indexOf('promo-') >= 0) {
+        if (column.field == 'no') {
+          return {
+            rowspan: 1,
+            colspan: this.colspanNums
           }
-          // 显示折扣价
-          const discountPriceFormat = function(record,data,h) {
-            return (
-              <div>
-                {_this.toThousands(data)}
-                {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
-                  <span title="原价">({ _this.toThousands(record.origPrice)})</span>
-                ):''}
-              </div>
-            )
+        } else {
+          return {
+            rowspan: 0,
+            colspan: 0
           }
+        }
+      }
+    },
+    // 查看活动详情
+    showDesc (row) {
+      this.detailSn = row.promoRuleSn
+      this.openDetailModal = true
+    },
+    // 获取销售单参与的活动列表
+    pageInit () {
+      salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
+        if (res.status == 200) {
+          this.activeList = res.data || []
+        }
+        this.$nextTick(() => {
+          this.searchTable()
+        })
+      })
+    },
+    // 查询表格数据
+    async searchTable () {
+      this.dataSource = []
+      this.disabled = true
+      this.spinning = true
+      // 参数
+      const params = {
+        salesBillSn: this.salesBillSn,
+        showStock: this.showStock,
+        warehouseSn: this.warehouseSn,
+        promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
+      }
+      // 参与活动数据
+      const active = this.activeList.filter(item => item.enabledFlag == 1)
+
+      // 正常产品
+      const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
+      const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
+      const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
 
-          let arr= [
-                { title: '序号', field: 'no',key: "a", width: 50, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row,row[column.field],h)} },
-                { title: '产品编码', field: 'productCode',key: "b", width: 150, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
-                { title: '产品名称', field: 'productName',key: "c", width: 250, align: 'left',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '原厂编码', field: 'productOrigCode',key: "d", width: 150, align: 'left',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
-                { title: '出库仓库', field: 'warehouseName',key: "e", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
-            ]
-            this.colspanNums = this.showConvertPromoGifts ? 6 : 5
-            if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
-              this.colspanNums = this.colspanNums + 1
-              arr.push({ title: '成本价', field: 'showCost', width: 80,key: "f", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
-            }
-            this.colspanNums = this.colspanNums + 2
-            arr = arr.concat([
-                { title: '单位', field: 'productOrigUnit',key: "g", width: 80, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '销售数量', field: 'qty', width: 80,key: "h", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} }
-            ])
+      // 没有活动时,表格不显示统计数据
+      let listData = active.length ? (proList.length ? [{
+        id: 'promo-normal',
+        total: norTotal
+      }, ...proList] : []) : proList
 
-            if (this.$hasPermissions(this.authCode + '_provincePrice')) {
-              this.colspanNums = this.colspanNums + 1
-              arr.push({ title: '省级价', field: 'provincePrice', width: 80,key: "i", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
-            }
-            // 是否勾选市级价格
-            if (this.isCityPrice) {
-              this.colspanNums = this.colspanNums + 1
-                arr.push({ title: '市级价', field: 'cityPrice', width: 80,key: "j", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
-                if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-                  this.colspanNums = this.colspanNums + 1
-                    arr.push({ title: '销售价', field: 'price', width: 100,key: "k", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row,row[column.field],h)} })
-                }
-            } else {
-                if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-                  this.colspanNums = this.colspanNums + 1
-                    arr.push({ title: '销售价', field: 'price', width: 100,key: "l", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row,row[column.field],h)} })
-                }
-            }
+      // 有促销活动产品
+      if (params.promotionFlag != 0) {
+        // 循环获取活动产品
+        for (let i = 0; i < active.length; i++) {
+          const promo = active[i]
+          const activeParams = {
+            promoRuleSn: promo.promoRuleSn,
+            promoSn: promo.promoSn,
+            salesPromoSn: promo.salesPromoSn,
+            ...params
+          }
 
-            if (this.showStock) { //  审核,需用到库存
-              this.colspanNums = this.colspanNums + 1
-                arr.push({ title: '库存', field: 'stockQty', width: 80,key: "m", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
-            }
-            this.colspanNums = this.colspanNums + 3
-            arr = arr.concat([
-                { title: '待下推数', field: 'unpushedQty', width: 80,key: "o", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-                { title: '已下推数', field: 'pushedQty', width: 80,key: "p", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-            ])
-            
-            if(this.showConvertPromoGifts){
-              arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 100,key: "z", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.convertPromoGiftsFlag ? numsFormat(row[column.field]) : '--'} })
-            }
-            arr.push({ title: '已取消数', field: 'cancelQty', width: 80,key: "q", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
-          return arr
-        },
-        hasConvertPromoGifts(){
-          return this.detailData && this.detailData.totalConvertPromoGiftsQty
-        },
-        showConvertPromoGifts(){
-          return this.activeList&&this.activeList.filter(item=>item.enabledFlag == 1).find(item => item.promotionRule&&item.promotionRule.convertExpenseFlag==1&&item.promotionRule.promotionRuleType=='BUY_PROD_GIVE_PROD')
-        },
-        showStock(){
-            return this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')
+          // 获取活动产品统计
+          const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+          if (acTotal) {
+            // 采购额结余
+            acTotal.cgejyAmount = (Number(acTotal.totalPromoGiftsAmount || 0) - Number(acTotal.totalUsePromoGiftsAmount || 0)).toFixed(2)
+            // 采购额超出
+            acTotal.cgeccAmount = (Number(acTotal.totalUsePromoGiftsAmount || 0) - Number(acTotal.totalPromoGiftsAmount || 0)).toFixed(2)
+          }
+          // 有数据时才调用接口,避免做无用的调用
+          if (acTotal && acTotal.totalQty) {
+            // 获取活动产品列表
+            const aclist = await salesDetailAllList(activeParams).then(res => res.data)
+            // 合并结果数据
+            const retList = aclist.length ? [{
+              id: 'promo-' + i,
+              promo: promo,
+              total: acTotal
+            }, ...aclist] : []
+            // 将活动产品数据拼接
+            listData = aclist && aclist.length ? listData.concat(retList) : listData
+          }
         }
-      },
-      watch: {
-        showCityPrice(newValue, oldValue){
-            this.isCityPrice = newValue
+        // 如果活动没有任何产品,不显示统计一行
+        if (active.length) {
+          const hasAcp = listData.filter(item => item.id != 'promo-normal').filter(item => item.id.indexOf('promo-') >= 0)
+          if (hasAcp && hasAcp.length == 0) {
+            listData = listData.filter(item => item.id.indexOf('promo-') < 0) || []
+          }
         }
-      },
-      methods: {
-        // 关闭详情弹窗
-        closeDetailModal () {
-          this.detailSn = null
-          this.openDetailModal = false
-        },
-         // 合并活动分类单元格
-        bodyCellSpan({ row, column, rowIndex }) {
-          if (row.id.indexOf('promo-')>=0) {
-            if(column.field=='no'){
-              return {
-                        rowspan: 1,
-                        colspan: this.colspanNums,
-                    };
-            }else{
-              return {
-                    rowspan: 0,
-                    colspan: 0,
-                }
-            }
+      }
+      // 赋值
+      this.dataSource = listData
+      // 格式化数据
+      let f = 0
+      let str = ''
+      this.outStockStr = ''
+      this.dataSource.map((item, i) => {
+        if (item.id.indexOf('promo-') >= 0) { f = f - 1 }
+        item.no = i + 1 + f
+        // 格式化数据
+        const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
+        const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
+        const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
+        const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
+        item.productCode = productCode || '--'
+        item.productName = productName || '--'
+        item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+        item.productOrigUnit = productOrigUnit || '--'
+        item.epushedQty = Number(item.pushedQty) - Number(item.pushQty)
+        if (item.unpushedQty && (Number(item.stockQty) < Number(item.unpushedQty))) {
+          str += item.productCode + '、'
+          if (item.promotionFlag != 0) {
+            this.hasOutStockOfActive = true
           }
-        },
-         // 查看活动详情
-        showDesc(row){
-          this.detailSn = row.promoRuleSn
-          this.openDetailModal = true
-        },
-        // 获取销售单参与的活动列表
-        pageInit(){
-          salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
-            if(res.status == 200){
-              this.activeList = res.data || []
-            }
-            this.$nextTick(()=>{
-              this.searchTable()
-            })
-          })
-        },
-        async searchTable(){
-            this.dataSource = []
-            this.disabled = true
-            this.spinning = true
-            // 参数
-            const params = {
-                salesBillSn: this.salesBillSn,
-                showStock: this.showStock,
-                warehouseSn: this.warehouseSn,
-                promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
-            }
-            const active = this.activeList.filter(item => item.enabledFlag == 1)
-
-            // 正常产品
-            const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
-            const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
-            const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
-            // 没有活动时,表格不显示统计数据
-            let listData = active.length ? (proList.length ? [{
-                id: 'promo-normal',
-                total: norTotal
-              },...proList] : []) : proList
-            
-            if(params.promotionFlag != 0){  
-              // 循环获取活动产品
-              for(let i=0;i<active.length;i++){
-                const promo = active[i]
-                const activeParams = {
-                  promoRuleSn: promo.promoRuleSn,
-                  promoSn: promo.promoSn,
-                  salesPromoSn: promo.salesPromoSn,
-                  ...params
-                }
-                
-                // 获取活动产品统计
-                const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
-                if(acTotal){
-                  // 采购额结余
-                  acTotal.cgejyAmount = (Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)).toFixed(2)
-                  // 采购额超出
-                  acTotal.cgeccAmount = (Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)).toFixed(2)
-                }
-                // 有数据时才调用接口,避免做无用的调用
-                if(acTotal&&acTotal.totalQty){
-                  // 获取活动产品列表
-                  const aclist = await salesDetailAllList(activeParams).then(res => res.data)
-                  
-                  const retList = aclist.length ? [{
-                    id: 'promo-'+i,
-                    promo: promo,
-                    total: acTotal
-                  },...aclist] : []
-                  // 将活动产品数据拼接
-                  listData = aclist&&aclist.length ? listData.concat(retList) : listData
-                }
-              }
-              console.log(listData)
-              // 如果活动没有任何产品,不显示统计一行
-              if(active.length){
-                const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
-                if(hasAcp && hasAcp.length==0){
-                  listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
-                }
-              }
-            }
-            console.log(listData)
-            this.dataSource = listData
-            
-            // 格式化数据
-            let f = 0
-            this.outStockStr = ''
-            let str = ''
-            this.dataSource.map((item,i) => {
-              if(item.id.indexOf('promo-')>=0){f = f - 1}
-              item.no = i + 1 + f
-              const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
-              const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
-              const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
-              const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
-              item.productCode = productCode || '--'
-              item.productName = productName || '--'
-              item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
-              item.productOrigUnit = productOrigUnit || '--'
-              item.epushedQty = Number(item.pushedQty) - Number(item.pushQty)
-              if (item.unpushedQty && (Number(item.stockQty) < Number(item.unpushedQty))) {
-                  str += item.productCode + '、'
-                  if(item.promotionFlag != 0){
-                    this.hasOutStockOfActive = true
-                  }
-              }
-            })
-            if (str.length > 0) {
-                str = str.substr(0, str.length - 1)
-                this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
-            }
-            this.showEmpty = this.dataSource.length <= 0
-            this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
-            this.spinning = false
-            this.disabled = false
-        },
+        }
+      })
+      if (str.length > 0) {
+        str = str.substr(0, str.length - 1)
+        this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
       }
+      this.showEmpty = this.dataSource.length <= 0
+      this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
+      this.spinning = false
+      this.disabled = false
     }
-  </script>
-  
+  }
+}
+</script>
+
   <style lang="less">
     .empty-data{
         color: #999;
@@ -407,11 +431,11 @@
         background: #f3f8fa;
       }
     }
-    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.table-body-cell-no, 
+    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.table-body-cell-no,
     .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
       padding: 0;
-    } 
+    }
     .ve-table .ve-table-container .ve-table-content-wrapper{
       border-bottom: 1px solid #ddd;
     }
-  </style>
+  </style>

+ 9 - 9
src/views/salesManagement/salesQueryNew/comps/importGuideModal.vue

@@ -80,11 +80,11 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
+    params: { // 参数
       type: Object,
       default: null
     },
-    promoProductClz:{
+    promoProductClz: { // 活动产品类型
       type: String,
       default: ''
     }
@@ -93,15 +93,15 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/sales/detail/importParse',
-      paramsData: null,
-      uploadParams: {
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/sales/detail/importParse', // 解析地址
+      paramsData: null, // 参数数据
+      uploadParams: { // 上传参数
         salesBillSn: this.params.salesBillSn,
-        salesPromoSn: this.params.salesPromoSn||'', 
-        promoProductClz: this.promoProductClz||''
+        salesPromoSn: this.params.salesPromoSn || '',
+        promoProductClz: this.promoProductClz || ''
       },
       exportLoading: false,
-      filePath: location.protocol + '//' + location.host + '/templ/销售导入产品模板.xlsx'
+      filePath: location.protocol + '//' + location.host + '/templ/销售导入产品模板.xlsx' // 模板文件地址
     }
   },
   methods: {
@@ -146,7 +146,7 @@ export default {
         this.$emit('close')
         this.paramsData = null
         this.$refs.importUpload.setFileList('')
-      }else{
+      } else {
         this.uploadParams.promoProductClz = this.promoProductClz
       }
     }

+ 13 - 6
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -81,7 +81,7 @@
             type="link"
             class="button-info"
             @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
-
+          <!-- // 操作按钮 -->
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
               <a-menu-item key="3" :disabled="disablePromo">
@@ -102,7 +102,7 @@
               class="button-info"
             > 批量操作 <a-icon type="down" /> </a-button>
           </a-dropdown>
-
+          <!-- 导入操作 -->
           <a-dropdown :disabled="disablePromo">
             <a-menu slot="overlay" @click="handleImportClick">
               <a-menu-item key="GATE" v-if="promo&&promo.promotionRule&&promo.promotionRule.gateFlag==='1'">
@@ -292,18 +292,20 @@ import {
   updateWarehouse,
   salesBatchInsert
 } from '@/api/salesDetailNew'
+
 export default {
   name: 'ProductList',
   mixins: [commonMixin],
   components: {
     STable,
     VSelect,
+    // 导入弹框组件
     ImportGuideModal,
     chooseWarehouse,
-    setWarehouse,
-    ProductBrand,
-    productTypeAll,
-    updateActiveModal
+    setWarehouse, // 设置仓库组件
+    ProductBrand, // 产品品牌组件
+    productTypeAll, // 产品分类组件
+    updateActiveModal// 更换活动弹框组件
   },
   props: {
     openModal: { //  弹框显示状态
@@ -311,22 +313,27 @@ export default {
       default: false
     },
     newLoading: Boolean,
+    // 详情数据
     detailData: {
       type: Object,
       default: function () { return null }
     },
+    // 活动规则数据
     promo: {
       type: Object,
       default: function () { return null }
     },
+    // 表格id
     id: {
       type: String,
       default: ''
     },
+    // 仓库sn
     warehouseSn: {
       type: String,
       default: ''
     },
+    // 销售单sn
     salesBillSn: {
       type: String,
       default: ''

+ 21 - 18
src/views/salesManagement/salesQueryNew/detail.vue

@@ -66,7 +66,7 @@
         </div>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <!-- alert -->
+        <!-- 统计信息 -->
         <a-alert type="info" style="margin-bottom: 10px;">
           <div slot="message">
             <div>
@@ -257,26 +257,25 @@ export default {
     return {
       spinning: false,
       disabled: false,
-      showDsModal: false,
-      showStockOut: false,
+      showDsModal: false, // 一键审核弹框
+      showStockOut: false, // 缺货明细弹框
       authCode: '', // 权限码
       hasData: false, // 是否有数据
-      showDetail: false,
-      openModal: false,
+      showDetail: false, // 基础信息是否显示
+      openModal: false, // 打印导出弹框
       detailData: null, //  详情数据
-      nowType: null,
+      nowType: null, // 打印导出类型
       isCityPrice: false, //  是否显示市级价
-      visibleAudit: false,
-      auditInfo: null,
-      spinningAudit: false,
-      auditText: null,
-      fromRouter: null,
-      warehouseSn: undefined,
-      promoFlag: undefined
+      visibleAudit: false, // 审核弹框
+      spinningAudit: false, // 审核loading
+      auditText: null, // 审核备注信息
+      fromRouter: null, // 从那个页面打开当前页面
+      warehouseSn: undefined, // 所在仓库
+      promoFlag: undefined // 产品类型
     }
   },
   computed: {
-    // 地址
+    // 详细地址
     shippingAddress () {
       const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
       const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
@@ -288,16 +287,20 @@ export default {
         return shippingAddrProvinceName + shippingAddrCityName + shippingAddrCountyName + shippingAddr
       }
     },
+    // 是否因此底部栏按钮
     hideFooter () {
       const detailData = this.detailData
       return detailData && (detailData.billStatus == 'HQ_CHANGE' || (detailData.salesBillSource != 'SALES' && detailData.billStatus == 'AUDIT_REJECT') || detailData.billStatus == 'FINISH' || detailData.billStatus == 'OUTING_WAREHOUSE')
     },
+    // 是否有促销活动产品
     hasPrompActive () {
       return this.detailData && this.detailData.promoFlag == 1
     },
+    // 是否有促销产品(转采购额)
     showConvertPromoGifts () {
       return this.$refs.productList && this.$refs.productList.showConvertPromoGifts
     },
+    // 表格高度计算
     pageHeight () {
       return window.innerHeight - 305 + (this.hideFooter ? 45 : 0)
     }
@@ -324,7 +327,7 @@ export default {
     searchTable () {
       this.$refs.productList.searchTable()
     },
-    //  详情
+    // 详情
     getDetail () {
       salesDetailBySn({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
@@ -334,7 +337,7 @@ export default {
         this.$refs.productList.pageInit()
       })
     },
-    // 打开缺货明细
+    // 打开缺货明细弹框
     openStockOut () {
       if (this.$refs.productList.outStockStr != '') {
         this.showStockOut = true
@@ -424,7 +427,7 @@ export default {
         }
       })
     },
-    // 打印导出
+    // 打印导出弹框
     handlePrint (type, authCode) {
       const _this = this
       _this.$store.state.app.curActionPermission = authCode
@@ -444,8 +447,8 @@ export default {
         this.openModal = true
       }
     },
+    // 关闭打印弹框
     closePrint () {
-      console.log(9)
       this.$store.state.app.curActionPermission = ''
       this.openModal = false
     },

File diff suppressed because it is too large
+ 478 - 477
src/views/salesManagement/salesQueryNew/detailAll.vue


+ 1 - 1
src/views/salesManagement/salesQueryNew/receivingAddress/chooseAddressModal.vue

@@ -91,7 +91,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: String || Number,
       default: ''
     }

+ 5 - 3
src/views/salesManagement/salesQueryNew/receivingAddress/editAddressModal.vue

@@ -88,7 +88,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: String || Number,
       default: ''
     }
@@ -97,11 +97,12 @@ export default {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      isEdit: false,
+      isEdit: false, // 是否编辑
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 表单数据
       form: {
         consigneeName: '',
         consigneeTel: '',
@@ -113,6 +114,7 @@ export default {
         countyName: '',
         addr: ''
       },
+      // 表单规则
       rules: {
         consigneeName: [
           { required: true, message: '请输入收货人', trigger: 'change' }
@@ -155,7 +157,6 @@ export default {
             }
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -253,6 +254,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置表单
         this.$refs.ruleForm.resetFields()
         this.addrCityList = []
         this.addrDistrictList = []

Some files were not shown because too many files changed in this diff