lilei 1 year ago
parent
commit
ae2150d610

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

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

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

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