Bläddra i källkod

Merge branch 'develop_yh42' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh42

chenrui 1 år sedan
förälder
incheckning
4c015f2430

+ 31 - 29
src/views/salesManagement/salesOrderWarehouse/detail.vue

@@ -20,28 +20,28 @@
             @click="handlePrint">导出Excel</a-button>
         </template>
       </a-page-header>
-       
+
       <!-- 基础信息 -->
       <a-card size="small" :bordered="false" class="salesDetail-cont" v-show="showDetail">
         <div v-if="detailData">
-         <a-descriptions size="small" :column="3">
-           <a-descriptions-item label="销售单号">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="创建时间">{{ detailData.createDate || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
-           </a-descriptions-item>
-           <a-descriptions-item label="收货人" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="收货电话" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
-         </a-descriptions>
+          <a-descriptions size="small" :column="3">
+            <a-descriptions-item label="销售单号">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="创建时间">{{ detailData.createDate || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
+            </a-descriptions-item>
+            <a-descriptions-item label="收货人" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货电话" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+          </a-descriptions>
         </div>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <!-- alert -->
+        <!-- 统计 -->
         <a-alert type="info" style="margin-bottom: 10px;" v-if="countData">
           <div slot="message">
             <span>
@@ -88,7 +88,7 @@ import printModal from './printModal.vue'
 export default {
   name: 'SalesOrderWarehouseDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect ,printModal},
+  components: { STable, VSelect, printModal },
   data () {
     return {
       disabled: false,
@@ -111,10 +111,10 @@ export default {
       },
       detailData: null, //  详情数据
       countData: null, // 数量数据
-      fromRouter: null,
-      openModal:false,
-      showDetail: false,
-      tableHeight: 300
+      fromRouter: null, // 打开此页面的来源页面
+      openModal: false, // 导出Excel
+      showDetail: false, // 是否显示详情
+      tableHeight: 300 // 表格高度
     }
   },
   computed: {
@@ -131,25 +131,27 @@ export default {
         arr.splice(4, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
-    },
+    }
   },
   watch: {
-    showDetail(newValue, oldValue) {
+    // 监听详情显示隐藏,并计算表格高度
+    showDetail (newValue, oldValue) {
       this.getTableHeight()
     }
   },
   methods: {
-    getTableHeight(){
-      this.tableHeight =  window.innerHeight - (this.showDetail ? 376 : 265)
+    // 表格高度
+    getTableHeight () {
+      this.tableHeight = window.innerHeight - (this.showDetail ? 376 : 265)
     },
-    handlePrint(){
+    // 导出Excel
+    handlePrint () {
       this.openModal = true
     },
     // 确定打印或预览,导出
     handleOk (objs) {
       const _this = this
       const params = JSON.parse(JSON.stringify(objs))
-      console.log(params)
       delete params.type
       _this.spinning = true
       exportExcel(salesDetailExcel, params, '销售清单' + moment().format('YYYYMMDDHHmmss'), () => {
@@ -163,7 +165,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesOrderWarehouseList' })
     },
-    //  详情
+    //  获取详情
     getDetail () {
       salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
@@ -174,7 +176,7 @@ export default {
         }
       })
     },
-    // 数量
+    // 统计数据
     getCount () {
       queryCountForWarehouseDetail({ salesBillSn: this.$route.params.sn, warehouseSn: this.$route.params.wsn }).then(res => {
         if (res.status == 200) {

+ 112 - 108
src/views/salesManagement/salesOrderWarehouse/list.vue

@@ -1,102 +1,102 @@
 <template>
   <div>
-  <!-- 搜索条件 -->
-  <a-card size="small" :bordered="false" class="searchBoxNormal">
-    <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form-model
-        id="salesOrderWarehouseList-form"
-        ref="ruleForm"
-        class="form-model-con"
-        layout="inline"
-        :rules="rules"
-        :model="queryParam"
-        @keyup.enter.native="handleSearch">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="创建时间" prop="time">
-              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="客户名称">
-              <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesManagementList-buyerName" @change="custChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="销售单号">
-              <a-input id="salesOrderWarehouseList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="业务状态">
-              <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="salesManagementList-billStatus"
-                code="SALES_BILL_STATUS"
-                placeholder="请选择业务状态"
-                allowClear></v-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
-              <Area id="salesOrderWarehouseList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24" v-show="isShowWarehouse">
-            <a-form-model-item label="出库仓库">
-              <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
-            <a-button
-              style="margin-left: 10px"
-              type="primary"
-              class="button-warning"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              v-if="$hasPermissions('B_salesOrderWarehouseExport')"
-            >导出</a-button>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-  </a-card>
- 
-  <a-card size="small" :bordered="false" class="salesOrderWarehouseList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <div class="tongji-bar" style="margin-bottom:10px">
-        <!-- 总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '0' }}</strong>; -->
-        总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+    <!-- 搜索条件 -->
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model
+          id="salesOrderWarehouseList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="创建时间" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesManagementList-buyerName" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="销售单号">
+                <a-input id="salesOrderWarehouseList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="业务状态">
+                <v-select
+                  v-model="queryParam.billStatus"
+                  ref="billStatus"
+                  id="salesManagementList-billStatus"
+                  code="SALES_BILL_STATUS"
+                  placeholder="请选择业务状态"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
+                <Area id="salesOrderWarehouseList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-show="isShowWarehouse">
+              <a-form-model-item label="出库仓库">
+                <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salesOrderWarehouseExport')"
+              >导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
       </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+68+'px' }"
-        size="small"
-        :rowKey="(record) => record.no"
-        rowKeyName="no"
-        :columns="columns"
-        :pageSize="30"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 单号 -->
-        <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
-          <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-          <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 导出提示框 -->
-    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
-  </a-card>
-   </div>
+    </a-card>
+
+    <a-card size="small" :bordered="false" class="salesOrderWarehouseList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div class="tongji-bar" style="margin-bottom:10px">
+          <!-- 总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '0' }}</strong>; -->
+          总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+68+'px' }"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :pageSize="30"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 单号 -->
+          <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
+            <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+            <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 导出提示框 -->
+      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    </a-card>
+  </div>
 </template>
 
 <script>
@@ -124,19 +124,20 @@ export default {
           moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
           moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
         ],
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         buyerSn: '', //  客户名称
         billStatus: 'WAIT_AUDIT', //  业务状态
         salesBillNo: '', // 销售单号
-        shippingAddrProvinceSn: undefined,
-        warehouseSn: undefined
+        shippingAddrProvinceSn: undefined, // 地址sn
+        warehouseSn: undefined // 仓库sn
       },
-      exportLoading: false,
+      exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
       loading: false,
-      totalData: null,
-      showExport: false,
+      totalData: null, // 统计信息
+      showExport: false, // 导出提示框
+      // 校验规则
       rules: {
         'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
       },
@@ -173,9 +174,10 @@ export default {
         { title: '总数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-	  if (this.isShowWarehouse) {
-	    arr.splice(5, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
-	  }
+      // 如果显示仓库
+      if (this.isShowWarehouse) {
+        arr.splice(5, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+      }
       return arr
     }
   },
@@ -192,6 +194,7 @@ export default {
         }
       })
     },
+    // 选择客户
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
@@ -216,7 +219,7 @@ export default {
         _this.showExport = true
       })
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -243,10 +246,11 @@ export default {
       this.queryParam.warehouseSn = undefined
       this.$refs.table.refresh(true)
     },
-    //  详情
+    //  打开详情页面
     handleDetail (row) {
       this.$router.push({ path: `/salesManagement/salesOrderWarehouse/detail/${row.salesBillSn}/${row.warehouseSn}` })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 21 - 17
src/views/salesManagement/salesOrderWarehouse/printModal.vue

@@ -48,13 +48,13 @@ export default {
       type: Boolean,
       default: false
     },
-    itemData: {
+    itemData: { // 单据详情信息
       type: Object,
       default: () => {
         return null
       }
     },
-    nowType: {
+    nowType: { // 导出类型
       type: String,
       default: ''
     }
@@ -62,12 +62,14 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 导出选项
       form: {
         id: 'all',
         dataScope: 'all',
         priceType: undefined,
-        orgCode: "1"
+        orgCode: '1'
       },
+      // 选项校验
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
@@ -78,7 +80,7 @@ export default {
         wrapperCol: { span: 15 }
       },
       spinning: false,
-      typeList: []
+      typeList: [] // 产品分类
     }
   },
   computed: {
@@ -92,16 +94,17 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-           _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'
-           _this.form.priceType += _this.form.orgCode == "1" ? '_ORIG_CODE':''
-           const obj = {
-             salesBillSn: _this.itemData.salesBillSn,
-             priceType: _this.form.priceType,
-             dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
-             type: isPrint || 'preview'
-           }
-           _this.$emit('ok', obj)
-           _this.isShow = false
+          // 价格类型
+          _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK' : 'SALES_BILL'
+          _this.form.priceType += _this.form.orgCode == '1' ? '_ORIG_CODE' : ''
+          const obj = {
+            salesBillSn: _this.itemData.salesBillSn,
+            priceType: _this.form.priceType,
+            dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
+            type: isPrint || 'preview'
+          }
+          _this.$emit('ok', obj)
+          _this.isShow = false
         } else {
           console.log('error submit!!')
           return false
@@ -110,8 +113,8 @@ export default {
     },
     // 取消选择分类
     handleCancel () {
-       this.isShow = false
-    },
+      this.isShow = false
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -122,11 +125,12 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置表单
         this.form = {
           id: 'all',
           dataScope: 'all',
           priceType: undefined,
-          orgCode: "1"
+          orgCode: '1'
         }
         this.$refs.ruleForm.resetFields()
       }

+ 32 - 26
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -377,37 +377,38 @@ export default {
           return data
         })
       },
-      showSearchBox: false,
-      showDescBox: false,
+      showSearchBox: false, // 是否显示筛选条件
+      showDescBox: false, // 收起展开规则详细
       openWarehouseModal: false, // 打开仓库设置
       openGuideModal: false, //  导入产品引导
-      delLoading: false,
-      chooseDisabled: false,
+      delLoading: false, // 删除logding
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
-        warehouseSn: undefined,
-        productCode: '',
-        productName: '',
-        productBrandSn: undefined,
+        warehouseSn: undefined, // 仓库
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productBrandSn: undefined, // 产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
-      productType: [],
-      rowSelectionInfo: null,
-      warehouseDataList: [],
-      openUpActiveModal: false,
-      descDetail: null,
+      productType: [], // 已选产品分类
+      rowSelectionInfo: null, // 已选产品数据
+      warehouseDataList: [], // 仓库列表数据
+      openUpActiveModal: false, // 更换促销活动弹框
+      descDetail: null, // 规则详细数据
       promoProductClz: null, // 活动产品分类
-      disablePromo: false,
-      countData: null,
-      warehouseTit: ''
+      disablePromo: false, // 是否禁用活动
+      countData: null, // 统计信息
+      warehouseTit: '' // 仓库设置唐卡标题
     }
   },
   computed: {
+    // 已选产品数量
     selectTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
+    // 表格列
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -418,10 +419,10 @@ export default {
         { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' },
         { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
+      // 售价权限
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) {
         arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'right', scopedSlots: { customRender: 'price' } })
         arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
         let idx = 0
@@ -441,17 +442,21 @@ export default {
     }
   },
   methods: {
+    // 仓库下拉列表筛选
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    // 仓库列表加载完成
     warehouseLoad (sn, list) {
       this.warehouseDataList = list
     },
+    // 显示查询条件
     showSearch () {
       this.showSearchBox = !this.showSearchBox
     },
+    // 显示规则详细
     showDesc (descDetail) {
       this.showDescBox = !this.showDescBox
       this.descDetail = descDetail
@@ -459,6 +464,7 @@ export default {
       this.descDetail.quotaAmount = Number(this.descDetail.quotaAmount).toFixed(2)
       this.$emit('showDesc', this.showDescBox)
     },
+    // 打开产品弹框
     openCpModal () {
       this.$emit('openCpModal', 1, this.id, this.countData)
     },
@@ -466,7 +472,7 @@ 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] : ''
@@ -474,7 +480,6 @@ export default {
     },
     // 禁用活动
     disableActive (flag) {
-      console.log(flag, '------')
       this.disablePromo = flag
     },
     // 统计
@@ -490,7 +495,7 @@ export default {
         }
       })
     },
-    //  重置
+    //  重置查询
     resetSearchForm (flag) {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -571,6 +576,7 @@ export default {
       }
       this.setWarehouseInfo(ajax_data)
     },
+    // 选择仓库确认
     chooseWarehouseOk (sn) {
       const _this = this
       const snArr = []
@@ -586,6 +592,7 @@ export default {
       }
       _this.setWarehouseInfo(ajax_data)
     },
+    // 更改仓库信息
     setWarehouseInfo (data) {
       const _this = this
       _this.spinning = true
@@ -600,6 +607,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 更多操作下拉菜单
     handleMenuClick (e) {
       const _this = this
       if (e.key == 0) { // 仓库设置
@@ -627,7 +635,7 @@ export default {
       }, record)
       this.openUpActiveModal = true
     },
-    // 已选产品  blur
+    // 已选产品数量修改
     onCellBlur (val, record) {
       const _this = this
       //  光标移出,值发生改变再调用编辑接口
@@ -650,7 +658,6 @@ export default {
         record.qty = record.qtyBackups
       }
     },
-
     // 删除产品
     handleDel (row) {
       const _this = this
@@ -686,6 +693,7 @@ export default {
       // 更换活动
       this.$emit('upActive', this.promo, data, params)
     },
+    // 更换活动成功
     upAcitveSuccess () {
       this.spinning = false
       this.openUpActiveModal = false
@@ -693,7 +701,6 @@ export default {
     },
     // 添加产品
     insterProduct (row, promotionFlag, promoProductClz) {
-      console.log(row, promotionFlag, promoProductClz)
       // 防止多次添加产品
       if (this.isInster) { return }
       this.saveNewProduct(row, promotionFlag, promoProductClz)
@@ -703,7 +710,6 @@ export default {
       this.$message.loading('正在添加产品...', 1)
       this.isInster = true
       this.spinning = true
-      console.log(row)
       const params = {
         salesPromoSn: this.promo.salesPromoSn,
         promoRuleSn: this.promo.promoRuleSn,
@@ -746,6 +752,7 @@ export default {
       this.openGuideModal = true
       this.promoProductClz = e.key
     },
+    // 关闭导入弹框
     closeGuideModel () {
       this.openGuideModal = false
       this.promoProductClz = ''
@@ -762,7 +769,6 @@ export default {
         params.promoRuleSn = this.promo.promoRuleSn
         params.promoProductClz = this.promoProductClz
       }
-
       salesBatchInsert(params).then(res => {
         if (res.status == 200) {
           this.$message.success('产品导入成功', 2.5)

+ 39 - 27
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -212,19 +212,19 @@ export default {
       default: false
     },
     newLoading: Boolean,
-    detailData: {
+    detailData: { // 销售单详情
       type: Object,
       default: function () { return null }
     },
-    warehouseSn: {
+    warehouseSn: { // 仓库sn
       type: String,
       default: ''
     },
-    salesBillSn: {
+    salesBillSn: { // 销售单sn
       type: String,
       default: ''
     },
-    showTotal: {
+    showTotal: { // 是否显示总计
       type: Boolean,
       default: true
     }
@@ -244,6 +244,7 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              // 存储变更前的数量和仓库
               data.list[i].qtyBackups = data.list[i].qty
               data.list[i].warehouseBackups = data.list[i].warehouseSn
             }
@@ -253,50 +254,51 @@ export default {
           return data
         })
       },
-      showSearch: false,
+      showSearch: false, // 收起展开搜索
       openWarehouseModal: false, // 打开仓库设置
       openGuideModal: false, //  导入产品引导
-      delLoading: false,
-      chooseDisabled: false,
+      delLoading: false, // 删除loading
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
-        warehouseSn: undefined,
-        productCode: '',
-        productName: '',
-        productBrandSn: undefined,
+        warehouseSn: undefined, // 仓库
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productBrandSn: undefined, // 产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
-      productType: [],
-      rowSelectionInfo: null,
-      warehouseDataList: [],
-      countData: null,
-      isInster: false,
-      warehouseTit: ''
+      productType: [], // 产品分类
+      rowSelectionInfo: null, // 已选的产品数据
+      warehouseDataList: [], // 仓库列表
+      countData: null, // 统计数据
+      isInster: false, // 是否添加
+      warehouseTit: '' // 仓库设置弹框标题
     }
   },
   computed: {
+    // 已选产品数量
     selectTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
+    // 表格高度
     tableHeight () {
       return window.innerHeight - 395
     },
+    // 表格列定义
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center' },
         { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
-        // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
         { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
         { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
+      // 售价权限
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) {
         arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
         arr.splice(8, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
@@ -305,11 +307,13 @@ export default {
     }
   },
   methods: {
+    // 仓库下拉列表筛选
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    // 仓库下拉列表数据加载完成
     warehouseLoad (sn, list) {
       this.warehouseDataList = list
     },
@@ -317,10 +321,11 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
+    // 打开产品列表弹框
     openCpModal () {
       this.$emit('openCpModal', 0, 'productNormalList')
     },
-    // 统计
+    // 获取统计
     getCount () {
       salesDetaiCount(Object.assign(this.queryParam, { showStock: true })).then(res => {
         if (res.status == 200) {
@@ -328,6 +333,7 @@ export default {
         }
       })
     },
+    // 删除全部已选产品
     handleBatchDelAll () {
       const _this = this
       if (_this.dataSource.length == 0) {
@@ -343,6 +349,7 @@ export default {
           deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.$refs.table.refresh(false)
+              // 触发事件给父级组件
               _this.$emit('insterOk', 'normal')
               _this.$message.success(res.message)
             }
@@ -374,6 +381,7 @@ export default {
           }).then(res => {
             if (res.status == 200) {
               _this.$refs.table.refresh(false)
+              // 触发事件给父级组件
               _this.$emit('insterOk', 'normal')
               _this.$message.success(res.message)
             }
@@ -382,7 +390,7 @@ export default {
         }
       })
     },
-    // 设置单个出库仓库
+    // 单个设置出库仓库
     handleWarehouseBox (row) {
       const snArr = [row.salesBillDetailSn]
       const ajax_data = {
@@ -392,6 +400,7 @@ export default {
       }
       this.setWarehouseInfo(ajax_data)
     },
+    // 选择仓库确认
     chooseWarehouseOk (sn) {
       const _this = this
       const snArr = []
@@ -406,6 +415,7 @@ export default {
       }
       _this.setWarehouseInfo(ajax_data)
     },
+    // 修改仓库
     setWarehouseInfo (data) {
       const _this = this
       _this.spinning = true
@@ -425,6 +435,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 操作下拉菜单
     handleMenuClick (e) {
       const _this = this
       if (e.key == 0) { // 仓库设置
@@ -444,7 +455,7 @@ export default {
         this.handleBatchDelAll()
       }
     },
-    // 已选产品  blur
+    // 已选产品 修改销售数量
     onCellBlur (val, record) {
       const _this = this
       //  光标移出,值发生改变再调用编辑接口
@@ -466,7 +477,7 @@ export default {
         record.qty = record.qtyBackups
       }
     },
-    // 重置
+    // 重置查询
     resetSearchForm (flag) {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -504,7 +515,6 @@ export default {
     },
     // 添加产品
     insterProduct (row, promotionFlag) {
-      console.log(row, promotionFlag)
       // 防止多次添加产品
       if (this.isInster) { return }
       this.saveNewProduct(row, promotionFlag)
@@ -536,6 +546,7 @@ export default {
         if (res.status == 200) {
           this.$message.success('产品添加成功', 2.5)
           this.resetSearchForm(true)
+          // 触发事件给父级组件
           this.$emit('insterOk', 'normal')
         }
         this.spinning = false
@@ -545,20 +556,21 @@ export default {
         this.isInster = false
       })
     },
+    // 导入产品弹框关闭
     closeGuideModel () {
       this.openGuideModal = false
     },
-    // 批量导入产品
+    // 批量导入产品确认
     hanldeOk (data, salesPromoSn) {
       const params = {
         salesBillSn: this.detailData.salesBillSn,
         salesBillDetailList: data
       }
-
       salesBatchInsert(params).then(res => {
         if (res.status == 200) {
           this.$message.success('产品导入成功', 2.5)
           this.resetSearchForm(true)
+          // 触发事件给父级组件
           this.$emit('insterOk', 'normal')
         }
       })

+ 34 - 20
src/views/salesManagement/salesQueryNew/edit.vue

@@ -182,27 +182,30 @@ export default {
       spinning: false,
       activeList: [], // 活动列表
       newActiveList: [], // 新活动列表
-      activeDesKey: {},
+      activeDesKey: {}, // 活动规则详情数据
       salesBillSn: null, // 销售单sn
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
-      warehouseSn: undefined,
+      warehouseSn: undefined, // 仓库sn
+      // 有价格变更前后总金额
       updataData: {
         totalRealAmount: '',
         totalAmount: ''
       },
       priceUpdateModal: false, // 价格更新弹窗
-      showDetail: false,
-      showCpModal: false,
-      cpCurRefId: '',
-      disabledActiveOption: null,
-      yhDetail: null,
-      showNewActiveModal: false
+      showDetail: false, // 显示详细基本信息
+      showCpModal: false, // 添加产品弹框
+      cpCurRefId: '', // 当前操作的活动id
+      disabledActiveOption: null, // 禁用活动选项
+      yhDetail: null, // 优惠明细
+      showNewActiveModal: false // 新活动弹框
     }
   },
   computed: {
+    // 是否显示统计信息
     showTotal () {
       return this.activeList.length > 0
     },
+    // 详细地址
     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 : ''
@@ -220,6 +223,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
     },
+    // 收起展开活动区域
     tooglePanel (item) {
       item.isActive = !item.isActive
       this.activeList.splice()
@@ -252,7 +256,7 @@ export default {
         }
       })
     },
-    // 判断是否全部调用完
+    // 轮询判断是否全部加载完了
     isAllLoadFinish (mlist) {
       const nid = setInterval(() => {
         const ret = []
@@ -265,7 +269,6 @@ export default {
           clearInterval(nid)
           this.spinning = false
         }
-        console.log(ret)
       }, 50)
     },
     // 刷新所有表格数据
@@ -273,9 +276,10 @@ export default {
       const activeList = this.activeList.filter(item => item.isActive)
       const mlist = []
       this.spinning = true
-      // 加载正常产品列表
+      // 刷新正常产品列表
       this.$refs.productNormalList.resetSearchForm()
       mlist.push(this.$refs.productNormalList)
+
       // 刷新所有活动产品列表
       activeList.map(item => {
         const row = this.$refs['productList-' + item.promoRuleSn][0]
@@ -307,7 +311,7 @@ export default {
         this.updateAllTable()
       }, 500)
     },
-    // 获取是否有新活动
+    // 获取是否有新活动,有则弹出弹框
     async getNewActive () {
       const hasNewActive = await salesQueryUnPartPromo({ salesBillSn: this.$route.params.sn, enabledFlag: '1' }).then(res => res.data)
       if (hasNewActive.length) {
@@ -315,20 +319,18 @@ export default {
         this.showNewActiveModal = true
       }
     },
+    // 新活动弹框,确认
     showNewActiveOk () {
       this.showNewActiveModal = false
       this.getOrderDetail(true)
     },
-    // 添加产品,包括正常和活动的产品
+    // 添加产品后,关闭弹框
     closeProductModal (type) {
       this.cpCurRefId = ''
       this.showCpModal = false
-      // 刷新表格
-      // this.insterActiveOk(['normal','promo'][type])
     },
     // 打开选择产品弹框
     openProductModal (type, refId, countData) {
-      console.log(type, refId, countData)
       const promo = this.activeList.find(item => item.promoRuleSn == refId)
       if (promo) {
         promo.countData = countData
@@ -339,14 +341,15 @@ export default {
     },
     // 添加活动产品成功的回调
     insterActiveOk (type) {
-      console.log(type)
       const mlist = []
       this.spinning = true
+      // 如果时活动产品
       if (type == 'promo') {
         // 刷新正常产品列表
         this.$refs.productNormalList.resetSearchForm()
         mlist.push(this.$refs.productNormalList)
       }
+      // 如果时正常产品
       if (type == 'normal') {
         // 刷新活动产品列表
         const activeList = this.activeList.filter(item => item.isActive)
@@ -358,9 +361,10 @@ export default {
       }
       // 判断是否全部调用完
       this.isAllLoadFinish(mlist)
+      // 重新获取详情信息
       this.getOrderDetail()
     },
-    // 新增产品
+    // 单击新增产品
     insterProduct (row, promotionFlag, type) {
       // 正常产品
       if (type == 0) {
@@ -390,10 +394,12 @@ export default {
             nt && nt.resetSearchForm()
             mlist.push(nt)
           }
+
           // 刷新正常活动
           const pnt = this.$refs.productNormalList
           pnt && pnt.resetSearchForm()
           mlist.push(pnt)
+
           // 刷新当前活动
           const ot = this.$refs['productList-' + oldPromo.promoRuleSn][0]
           ot && ot.upAcitveSuccess()
@@ -407,7 +413,7 @@ export default {
         }
       })
     },
-    // 选择价格类型  并更新
+    // 价格变更,需要选择价格类型  并更新价格
     updatePrice (type) {
       const ajax_data = {
         salesBillSn: this.salesBillSn,
@@ -416,6 +422,7 @@ export default {
       if (type == 0) {
         this.submitResult(ajax_data)
       } else {
+        // 批量更新价格
         updateBatch(this.updataData.detailList).then(res => {
           this.priceUpdateModal = false
           if (res.status == 200) {
@@ -434,9 +441,11 @@ export default {
       if (this.detailData && this.detailData.salesBillSource == 'PURCHASE') {
         submitCheck({ salesBillSn: this.salesBillSn }).then(res => {
           if (res.status == 200) {
+            // 如果有价格变更记录
             if (res.data.detailList.length > 0) {
               this.updataData = res.data
               this.$nextTick(() => {
+                // 打开变更价格弹框
                 this.priceUpdateModal = true
               })
             } else {
@@ -453,7 +462,6 @@ export default {
       const _this = this
       // 校验活动规则
       const vaildActive = await salesPromoValidaSubmit({ salesBillSn: this.salesBillSn }).then(res => res.data)
-      // console.log(vaildActive)
       const a = vaildActive.filter(item => item.type == 1) // 不可提交
       const b = vaildActive.filter(item => item.type == 0) // 可跳过继续提交
       // 弹出不符合规则弹框,不可提交
@@ -500,6 +508,7 @@ export default {
         }
       }
     },
+    // 提交销售单
     async submitOrder (data) {
       this.spinning = true
       const res = await salesWriteSubmit(data)
@@ -517,6 +526,7 @@ export default {
       item.promotionRule.upperLimitAmount = item.promotion.upperLimitAmount ? Number(item.promotion.upperLimitAmount).toFixed(2) : ''
       row && row.showDesc(item.promotionRule)
     },
+    // 展开活动规则详情回调
     showDescOk (v, item) {
       item.showDesc = v
       if (!item.isActive) {
@@ -622,13 +632,17 @@ export default {
         }
       })
     },
+    // 选择禁用活动选项
     changeDaOpt (e) {
       this.disabledActiveOption = e.target.value
     },
+    // 页面初始化
     pageInit () {
       this.salesBillSn = this.$route.params.sn
       this.warehouseSn = this.$route.params.sn ? this.$route.params.wSn : ''
+      // 获取销售单详情
       this.getOrderDetail(true)
+      // 是否有新活动
       this.getNewActive()
     }
   },

+ 81 - 81
src/views/salesManagement/salesQueryNew/newPromoModal.vue

@@ -1,90 +1,90 @@
 <template>
-    <a-modal
-      v-model="opened"
-      title="新活动提醒"
-      centered
-      :maskClosable="false"
-      :confirmLoading="confirmLoading"
-      width="30%"
-      :footer="null"
-      @cancel="cancel"
-    >
-      <a-spin :spinning="spinning" tip="Loading...">
-        <div style="padding: 0 50px;">
-          <div style="padding:10px 0;text-align:left;">
-            系统发布新的促销活动,是否要参与?
-          </div>
-          <div style="text-align:left;color:#00aaff;">
-            <a-checkbox-group v-model="newPromoSnList">
-              <a-row v-for="item in newActiveList" :key="item.promotionSn">
-                <a-col :span="24"><a-checkbox :value="item.promotionSn">{{ item.description }}</a-checkbox></a-col>
-              </a-row>
-            </a-checkbox-group>
-          </div>
+  <a-modal
+    v-model="opened"
+    title="新活动提醒"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    width="30%"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="padding: 0 50px;">
+        <div style="padding:10px 0;text-align:left;">
+          系统发布新的促销活动,是否要参与?
         </div>
-        <div style="margin-top:36px;text-align:center;">
-          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
-          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
+        <div style="text-align:left;color:#00aaff;">
+          <a-checkbox-group v-model="newPromoSnList">
+            <a-row v-for="item in newActiveList" :key="item.promotionSn">
+              <a-col :span="24"><a-checkbox :value="item.promotionSn">{{ item.description }}</a-checkbox></a-col>
+            </a-row>
+          </a-checkbox-group>
         </div>
-      </a-spin>
-    </a-modal>
-  </template>
-  
-  <script>
-  import { commonMixin } from '@/utils/mixin'
-  import { salesDetailAddPromo } from '@/api/salesDetailNew'
-  export default {
-    name: 'newPromoModal',
-    mixins: [commonMixin],
-    props: {
-      show: [Boolean],
-      newActiveList: [Array],
-      salesBillSn: [String]
-    },
-    data () {
-      return {
-        opened: this.show,
-        spinning: false,
-        newPromoSnList: [],
-        confirmLoading: false
-      }
-    },
-    methods: {
-      //  保存
-      handleSubmit () {
-        const _this = this
-        if(_this.newPromoSnList.length){
-            salesDetailAddPromo({
-              "salesBillSn": _this.salesBillSn,
-              "promoSnList": _this.newPromoSnList
-            }).then(res => {
-              if(res.status == 200){
-                _this.$emit('ok')
-              }
-            })
-          }else{
-            _this.$message.info("请选择要参与的新活动")
-            return true
+      </div>
+      <div style="margin-top:36px;text-align:center;">
+        <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
+        <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { salesDetailAddPromo } from '@/api/salesDetailNew'
+export default {
+  name: 'NewPromoModal',
+  mixins: [commonMixin],
+  props: {
+    show: [Boolean],
+    newActiveList: [Array],
+    salesBillSn: [String]
+  },
+  data () {
+    return {
+      opened: this.show,
+      spinning: false,
+      newPromoSnList: [], // 新活动选项sn
+      confirmLoading: false
+    }
+  },
+  methods: {
+    //  保存
+    handleSubmit () {
+      const _this = this
+      if (_this.newPromoSnList.length) {
+        salesDetailAddPromo({
+          'salesBillSn': _this.salesBillSn,
+          'promoSnList': _this.newPromoSnList
+        }).then(res => {
+          if (res.status == 200) {
+            _this.$emit('ok')
           }
-      },
-      cancel () {
-        this.opened = false
-        this.$emit('cancel')
+        })
+      } else {
+        _this.$message.info('请选择要参与的新活动')
+        return true
       }
     },
-    watch: {
-      show (newValue, oldValue) {
-        this.opened = newValue
-        if (!newValue) {
-          this.newPromoSnList = []
-        }else{
-            // 默认全选
-            this.newActiveList.map(item => {
-               this.newPromoSnList.push(item.promotionSn)
-            })
-        }
+    // 取消
+    cancel () {
+      this.opened = false
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (!newValue) {
+        this.newPromoSnList = []
+      } else {
+        // 默认全选
+        this.newActiveList.map(item => {
+          this.newPromoSnList.push(item.promotionSn)
+        })
       }
     }
   }
-  </script>
-  
+}
+</script>

+ 16 - 9
src/views/salesManagement/salesQueryNew/printModal.vue

@@ -27,6 +27,7 @@
             </a-select-option>
           </a-select>
         </a-form-model-item>
+        <!-- 如果是销售导出 -->
         <a-form-model-item label="是否缺货产品" prop="dataScope" v-if="nowType=='export'">
           <a-radio-group v-model="form.dataScope">
             <a-radio value="all">全部</a-radio>
@@ -34,27 +35,28 @@
             <a-radio value="LESS" :disabled="isDisabled">缺货</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 销售分类打印 -->
         <a-form-model-item label="产品售价" prop="priceType" v-if="nowType=='SALES_BILL_TYPE'&&$hasPermissions('B_salesTypePrint_salesPrice')">
-          <!-- 销售分类打印 -->
           <a-radio-group v-model="form.priceType">
             <a-radio value="SALES_BILL_TYPE_COST">打印</a-radio>
             <a-radio value="SALES_BILL_TYPE">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 销售打印 -->
         <a-form-model-item label="产品售价" prop="priceType" v-if="nowType=='SALES_BILL'&&$hasPermissions('B_salesPrint_salesPrice')">
-          <!-- 销售打印 -->
           <a-radio-group v-model="form.priceType">
             <a-radio value="SALES_BILL_COST">打印</a-radio>
             <a-radio value="SALES_BILL">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 销售导出 -->
         <a-form-model-item label="产品售价" prop="priceType" v-if="nowType=='export'&&$hasPermissions('B_salesDetailExport_salesPrice')">
-          <!-- 销售导出 -->
           <a-radio-group v-model="form.priceType">
             <a-radio :value="form.dataScope == 'ENOUGH' ? 'SALES_BILL_COST_NOT_LACK':'SALES_BILL_COST'">导出</a-radio>
             <a-radio :value="form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'">不导出</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 销售分类打印 -->
         <a-form-model-item label="货位编号" prop="orderBy" v-if="nowType=='SALES_BILL_TYPE'">
           <a-radio-group v-model="form.orderBy">
             <a-radio value="sbd.STACK_PLACE_CODE ASC">打印(↑升序)</a-radio>
@@ -80,13 +82,13 @@ export default {
       type: Boolean,
       default: false
     },
-    itemData: {
+    itemData: { // 单据详情信息
       type: Object,
       default: () => {
         return null
       }
     },
-    nowType: {
+    nowType: { // 操作类型,打印、分类打印、导出
       type: String,
       default: ''
     }
@@ -94,12 +96,14 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 打印、导出选项
       form: {
         id: 'all',
         dataScope: 'all',
         priceType: undefined,
         orderBy: undefined
       },
+      // 选项校验
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
@@ -111,10 +115,11 @@ export default {
         wrapperCol: { span: 15 }
       },
       spinning: false,
-      typeList: []
+      typeList: [] // 产品分类
     }
   },
   computed: {
+    // 弹框标题
     modalTit () {
       let title = ''
       if (this.nowType == 'SALES_BILL') {
@@ -126,6 +131,7 @@ export default {
       }
       return title
     },
+    // 是否禁用
     isDisabled () {
       const states = ['WAIT_SUBMIT', 'WAIT_AUDIT', 'AUDIT_REJECT']
       return this.itemData && states.includes(this.itemData.billStatus)
@@ -159,7 +165,7 @@ export default {
               }
               _this.$emit('ok', obj)
             }
-          } else if (_this.nowType == 'SALES_BILL') {
+          } else if (_this.nowType == 'SALES_BILL') { // 销售打印
             // 销售打印无权限不打印
             if (!_this.$hasPermissions('B_salesPrint_salesPrice')) {
               _this.form.priceType = 'SALES_BILL'
@@ -170,7 +176,7 @@ export default {
               type: isPrint || 'preview'
             }
             _this.$emit('ok', obj)
-          } else if (_this.nowType == 'export') {
+          } else if (_this.nowType == 'export') { // 销售导出
             // 销售导出无权限不导出
             if (!_this.$hasPermissions('B_salesDetailExport_salesPrice')) {
               _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK' : 'SALES_BILL'
@@ -185,7 +191,6 @@ export default {
           }
           _this.isShow = false
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -211,6 +216,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置表单选项
         this.form = {
           id: 'all',
           dataScope: 'all',
@@ -219,6 +225,7 @@ export default {
         }
         this.$refs.ruleForm.resetFields()
       } else {
+        // 如果是分类打印
         if (this.nowType == 'SALES_BILL_TYPE') {
           this.getTypeData()
         }

+ 4 - 2
src/views/salesManagement/salesQueryNew/setPriceModal.vue

@@ -39,10 +39,12 @@ export default {
   mixins: [commonMixin],
   props: {
     show: [Boolean],
+    // 变更前总金额
     totalRealAmount: {
       type: [String, Number],
       default: ''
     },
+    // 变更后总金额
     totalAmount: {
       type: [String, Number],
       default: ''
@@ -52,8 +54,8 @@ export default {
     return {
       opened: this.show,
       spinning: false,
-      priceVal: undefined,
-      confirmLoading: false,
+      priceVal: undefined, // 价格类型
+      confirmLoading: false, // 按钮loading
       radioStyle: {
         display: 'block',
         height: '30px',

+ 18 - 11
src/views/salesManagement/salesQueryNew/stockOutDetailModal.vue

@@ -7,6 +7,7 @@
     v-model="isShow"
     @cancel="isShow=false"
     width="70%">
+    <!-- 基本信息 -->
     <a-descriptions size="small" :column="2">
       <a-descriptions-item label="销售单号">
         {{ detailData&&detailData.salesBillNo || '--' }}
@@ -14,6 +15,7 @@
       </a-descriptions-item>
       <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
     </a-descriptions>
+    <!-- 列表 -->
     <a-spin :spinning="spinning" tip="Loading...">
       <s-table
         class="sTable fixPagination"
@@ -27,6 +29,7 @@
         :showPagination="false"
         :defaultLoadData="false"
         bordered>
+        <!-- 单号 -->
         <template slot="productCode" slot-scope="text, record">
           <span style="padding-right: 15px;">{{ text }}</span>
           <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
@@ -34,10 +37,11 @@
         </template>
         <!-- 销售价 -->
         <template slot="price" slot-scope="text, record">
-            {{ toThousands(text) }}
-            <span v-if="record.promotionFlag=='GIFT'||record.promotionFlag=='DISCOUNT'" title="原价">({{ toThousands(record.origPrice) }})</span>
+          {{ toThousands(text) }}
+          <span v-if="record.promotionFlag=='GIFT'||record.promotionFlag=='DISCOUNT'" title="原价">({{ toThousands(record.origPrice) }})</span>
         </template>
       </s-table>
+      <!-- 操作按钮 -->
       <div class="btn-cont" style="padding:20px 20px 0;text-align: center;">
         <a-button
           class="button-warning"
@@ -54,8 +58,8 @@
           :disabled="disabled"
           :loading="exportClassifyLoading"
           id="allocateBillList-export">分类导出Excel</a-button>
-          <a-button style="margin-left: 10px" @click="isShow=false">关闭</a-button>
-       </div>
+        <a-button style="margin-left: 10px" @click="isShow=false">关闭</a-button>
+      </div>
     </a-spin>
   </a-modal>
 </template>
@@ -70,15 +74,15 @@ export default {
   mixins: [commonMixin],
   components: { STable },
   props: {
-    openModal: {
+    openModal: { // 是否显示弹框
       type: Boolean,
       default: false
     },
-    salesBillSn: {
+    salesBillSn: { // 销售单号
       type: [Number, String],
       default: ''
     },
-    detailData: {
+    detailData: { // 详细信息
       type: Object,
       default: function () {
         return null
@@ -86,11 +90,11 @@ export default {
     }
   },
   data () {
-    const _this = this
     return {
       spinning: false,
       isShow: this.openModal,
       disabled: false,
+      // 导出loading
       exportLoading: false,
       exportClassifyLoading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -115,7 +119,7 @@ export default {
       }
     }
   },
-  computed:{
+  computed: {
     columns () {
       const _this = this
       const arr = [
@@ -127,8 +131,8 @@ export default {
         { title: '销售数量', dataIndex: 'salesQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      
-      if (this.$hasPermissions('B_salesDetail_salesPrice')) { // 售价权限
+      // 售价权限
+      if (this.$hasPermissions('B_salesDetail_salesPrice')) {
         arr.splice(6, 0, { title: '销售价', dataIndex: 'price', width: '8%', align: 'right', scopedSlots: { customRender: 'price' } })
         arr.splice(7, 0, { title: '销售金额', dataIndex: 'salesAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(8, 0, { title: '缺货金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
@@ -137,6 +141,7 @@ export default {
     }
   },
   methods: {
+    // 导出缺货产品
     handleExport () {
       const _this = this
       _this.exportLoading = true
@@ -148,6 +153,7 @@ export default {
         _this.disabled = false
       })
     },
+    // 缺货产品分类导出
     handleClassifyExport () {
       const _this = this
       _this.exportClassifyLoading = true
@@ -167,6 +173,7 @@ export default {
     isShow (nVal, oVal) {
       if (!nVal) {
         this.$emit('close')
+        // 清空表格
         this.$refs.table.clearTable()
       } else {
         this.$nextTick(() => {