lilei hace 2 años
padre
commit
276c388115

+ 7 - 1
src/components/Select/index.js

@@ -29,6 +29,12 @@ export default {
     isEnable: { // 是否只获取已启用的数据
       type: Boolean,
       default: false
+    },
+    notIn: {
+      type: Array,
+      default: function(){
+        return []
+      }
     }
   }),
   created () {
@@ -41,7 +47,7 @@ export default {
       isEnable: _this.isEnable ? 1 : undefined
     }).then(res => {
       if (res.status == 200) {
-        _this.dataList = res.data.list
+        _this.dataList = res.data.list.filter(item => _this.notIn.indexOf(item.code)<0)
       }
     })
   },

+ 36 - 9
src/views/numsGoodsShelves/redPacket/edit.vue

@@ -34,13 +34,16 @@
                 </a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">
-                  <a-form-model-item label="参与货架" prop="settleType">
+                <a-col :span="24">
+                  <a-form-model-item label="参与货架" prop="settleType" :label-col="{span: 3}" :wrapper-col="{span: 20}">
                     <a-button type="link" @click="openModal=true">点击选择</a-button>
                   </a-form-model-item>
                 </a-col>
-                <a-col :span="12">
-                  <a-form-model-item label="活动范围" prop="activeOrg" help="修配易码通用户下单后可获得红包奖励">
+              </a-row>
+              <a-row>
+                <a-col :span="24">
+                  <a-form-model-item label="活动范围" prop="activeOrg" :label-col="{span: 3}" :wrapper-col="{span: 20}">
+                    <div style="color:#999">修配易码通用户下单后可获得红包奖励</div>
                     <a-checkbox-group
                       v-model="form.activeOrg"
                       name="checkboxgroup"
@@ -50,8 +53,24 @@
                 </a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">
-                  <a-form-model-item label="备注" prop="remark">
+                <a-col :span="24">
+                  <a-form-model-item label="客服微信" prop="remark" :label-col="{span: 3}" :wrapper-col="{span: 20}">
+                    <Upload
+                      class="upload"
+                      v-model="form.storeImage"
+                      ref="storeImage"
+                      :fileSize="10"
+                      :maxNums="1"
+                      @remove="removeImage"
+                      @change="changeImage"
+                      listType="picture-card"></Upload>
+                    <div class="upload-desc" style="margin-left: 100px;color:#999">说明:单张大小小于10Mb,最多1张。</div>
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+              <a-row>
+                <a-col :span="24">
+                  <a-form-model-item label="备注" prop="remark" :label-col="{span: 3}" :wrapper-col="{span: 20}">
                     <a-textarea :rows="4" placeholder="请输入备注"></a-textarea>
                   </a-form-model-item>
                 </a-col>
@@ -64,19 +83,19 @@
           </a-form-model>
         </div>
       </a-card>
-      <!-- 修改结算方式弹窗 -->
+      <!-- 选择货架弹窗 -->
       <shelfModal :visible="openModal" :checkedList="pageInfo" @close="openModal=false"></shelfModal>
     </a-spin>
   </div>
 </template>
 
 <script>
-import { VSelect } from '@/components'
+import { VSelect, Upload } from '@/components'
 import { shelfDetail, shelfSettleRuleSave, settleRuleDetail } from '@/api/shelf.js'
 import shelfModal from './shelfModal.vue'
 import { toThousands } from '@/libs/tools.js'
 export default {
-  components: { shelfModal, VSelect },
+  components: { shelfModal, VSelect, Upload },
   data () {
     return {
       spinning: false,
@@ -141,6 +160,14 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$router.push({ name: 'redPacketList' })
     },
+    //  图片上传
+    changeImage (file) {
+      this.form.storeImage = file
+    },
+    removeImage () {
+      this.form.storeImage = ''
+      this.$refs.storeImage.setFileList('')
+    },
     // 活动详情
     getDetail () {
       this.spinning = true

+ 24 - 29
src/views/numsGoodsShelves/redPacket/redPacketStatistics.vue

@@ -73,7 +73,7 @@
           </a-row>
         </a-form>
         <div class="table-operator">
-          <a-button type="primary" class="button-error" id="redPacket-handleEdit">批量标记已发</a-button>
+          <a-button type="primary" class="button-error">批量标记已发</a-button>
           <span>已选2项</span>
         </div>
         <a-alert type="info" style="margin-bottom:10px">
@@ -95,15 +95,20 @@
         :row-selection="{ columnWidth: 40 }"
         @rowSelection="rowSelectionFun"
         :data="loadData"
-        :scroll="{ y: tableHeight, x: 2360 }"
+        :scroll="{ y: tableHeight, x: 1900 }"
         :defaultLoadData="false"
         bordered>
+        <template slot="orderNo" slot-scope="text, record">
+          <a @click="viewDetail(record)">{{ record.id }}</a>
+        </template>
         <template slot="action" slot-scope="text, record">
           <a-button size="small" type="link" class="button-info" @click="handlePublish(record)">标记已发</a-button>
           <a-button size="small" type="link" class="button-error" @click="handleDelete(record)">删除</a-button>
         </template>
       </s-table>
     </a-spin>
+    <!-- 详情弹框 -->
+    <statisticsDetail :visible="openModal" :itemData="itemData" @close="openModal=false"></statisticsDetail>
   </a-card>
 </template>
 
@@ -113,13 +118,15 @@ import { getShelfList } from '@/api/shelf.js'
 import dealerList from '@/views/common/dealerList.vue'
 import storeList from '@/views/common/storeList.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
+import statisticsDetail from './statisticsDetail.vue'
 export default {
   name: 'UserList',
-  components: { STable, VSelect, storeList, dealerList, rangeDate },
+  components: { STable, VSelect, storeList, dealerList, rangeDate, statisticsDetail },
   data () {
     return {
       spinning: false,
       advanced: false,
+      openModal: false,
       tableHeight: 0,
       // 查询参数
       queryParam: {
@@ -130,30 +137,21 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '60px', align: 'center' },
-        { title: '活动名称', dataIndex: 'shelfName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '货架名称', dataIndex: 'dealerName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '配件经销商', dataIndex: 'dealerName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '汽车修理厂', dataIndex: 'storeName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '活动名称', dataIndex: 'shelfName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货架名称', dataIndex: 'dealerName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '配件经销商', dataIndex: 'dealerName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '汽车修理厂', dataIndex: 'storeName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '员工姓名', dataIndex: 'createDate', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '员工手机号码', dataIndex: 'dealerName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '订单编号', dataIndex: 'storeName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '订单编号', dataIndex: 'orderNo', scopedSlots: { customRender: 'orderNo' }, width: '130px', align: 'center' },
         { title: '订单类型', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '订单状态', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '下单时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下单时间', dataIndex: 'createDate', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: 'VIN', dataIndex: 'settleTypeDictValue', width: '140px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '车型', dataIndex: 'storeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'storeName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'storeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '下单数量', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '售价', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '售价小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '成本小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '毛利小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '红包奖励时间', dataIndex: 'createDate', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '红包毛利比例', dataIndex: 'shelfPlaceNum', width: '90px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '红包金额', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '本单红包金额小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '红包发放状态', dataIndex: 'shelfPlaceNum', width: '100px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '红包发放时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '红包发放时间', dataIndex: 'createDate', width: '150px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '操作', width: '120px', align: 'left', scopedSlots: { customRender: 'action' }, fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -207,17 +205,14 @@ export default {
       }
       this.$refs.table.refresh(true)
     },
-    // 编辑/新增
-    handleEdit (row) {
-      if (row) { //  编辑
-        this.$router.push({ name: 'redPacketEdit', params: { shelfSn: row.sn } })
-      } else {
-        this.$router.push({ name: 'redPacketAdd' })
-      }
-    },
-    // 发布
+    // 标记发布
     handlePublish (row) {
     },
+    // 详情
+    viewDetail (row) {
+      this.itemData = row
+      this.openModal = true
+    },
     // 删除
     handleDelete (row) {
       const _this = this

+ 1 - 1
src/views/numsGoodsShelves/redPacket/shelfModal.vue

@@ -62,7 +62,7 @@ import { getShelfList } from '@/api/shelf.js'
 import dealerList from '@/views/common/dealerList.vue'
 import storeList from '@/views/common/storeList.vue'
 export default {
-  name: 'SettlementModifyModal',
+  name: 'ShelfModal',
   components: {
     STable, VSelect, storeList, dealerList
   },

+ 156 - 0
src/views/numsGoodsShelves/redPacket/statisticsDetail.vue

@@ -0,0 +1,156 @@
+<template>
+  <div>
+    <a-modal
+      centered
+      wrapClassName="settlementModifyModal-modal"
+      :footer="null"
+      :maskClosable="false"
+      title="订单详情"
+      v-model="isshow"
+      @cancle="handleBack"
+      width="80%">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-descriptions>
+            <a-descriptions-item label="活动名称">
+              Zhou Maomao
+            </a-descriptions-item>
+            <a-descriptions-item label="货架名称">
+              1810000000
+            </a-descriptions-item>
+            <a-descriptions-item label="配件经销商">
+              Hangzhou, Zhejiang
+            </a-descriptions-item>
+            <a-descriptions-item label="汽车修理厂">
+              empty
+            </a-descriptions-item>
+            <a-descriptions-item label="员工姓名">
+              No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
+            </a-descriptions-item>
+            <a-descriptions-item label="员工手机号码">
+              Zhou Maomao
+            </a-descriptions-item>
+            <a-descriptions-item label="订单编号">
+              1810000000
+            </a-descriptions-item>
+            <a-descriptions-item label="订单类型">
+              Hangzhou, Zhejiang
+            </a-descriptions-item>
+            <a-descriptions-item label="订单状态">
+              empty
+            </a-descriptions-item>
+            <a-descriptions-item label="红包奖励时间">
+              No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
+            </a-descriptions-item>
+            <a-descriptions-item label="红包发放状态">
+              No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
+            </a-descriptions-item>
+            <a-descriptions-item label="红包发放时间">
+              No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
+            </a-descriptions-item>
+          </a-descriptions>
+        </div>
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            红包金额小计:<strong>{{ totalData&&(totalData.totalPushedQty || totalData.totalPushedQty==0) ? totalData.totalPushedQty : '--' }}</strong>;
+          </div>
+        </a-alert>
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          rowKey="id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 350 }"
+          bordered>
+        </s-table>
+        <div style="padding:10px;text-align:center;">
+          <a-button type="default" @click="handleBack">关闭</a-button>
+        </div>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { getShelfList } from '@/api/shelf.js'
+export default {
+  name: 'StatisticsDetail',
+  components: {
+    STable, VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    itemData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isshow: this.visible,
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'storeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'storeName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下单数量', dataIndex: 'shelfPlaceNum', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '售价(终端会员价)', dataIndex: 'shelfPlaceNum', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '成本价(市级价)', dataIndex: 'shelfPlaceNum', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '售价小计', dataIndex: 'shelfPlaceNum', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '成本小计', dataIndex: 'shelfPlaceNum', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '毛利小计', dataIndex: 'shelfPlaceNum', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '红包毛利比例', dataIndex: 'shelfPlaceNum', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '红包金额', dataIndex: 'shelfPlaceNum', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return getShelfList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    handleBack () {
+      this.$emit('close')
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+<style lang="less">
+.settlementModifyModal-modal{
+  .ant-input-number-handler-wrap{
+    display: none;
+  }
+}
+</style>