Browse Source

中奖记录对接

1004749546@qq.com 4 years ago
parent
commit
7c7aa2f2a9

+ 27 - 0
src/api/luckyDraw.js

@@ -42,3 +42,30 @@ export const deleteLuckyDraw = (params) => {
     method: 'get'
     method: 'get'
   })
   })
 }
 }
+// 查询中奖记录
+export const getLuckyWinList = (params) => {
+  const url = `luckyDrawWin/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 发送快递
+export const sendExpress = (params) => {
+  return axios({
+    url: 'luckyDrawWin/sendExpress',
+    data: params,
+    method: 'post'
+  })
+}
+// 查获奖用户明细
+export const getLuckyDrawWinDetail = (params) => {
+  return axios({
+    url: `luckyDrawWin/findById/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}

+ 33 - 96
src/views/market/GoodsLogistics.vue

@@ -48,8 +48,8 @@
           id="network-edit-name"
           id="network-edit-name"
           :maxLength="30"
           :maxLength="30"
           v-decorator="[
           v-decorator="[
-            'formData.name',
-            { initialValue: formData.name, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入收货人姓名' }] }
+            'formData.receiverName',
+            { initialValue: formData.receiverName, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入收货人姓名' }] }
           ]"
           ]"
           placeholder="请输入收货人姓名(最多30个字符)"
           placeholder="请输入收货人姓名(最多30个字符)"
           allowClear />
           allowClear />
@@ -57,47 +57,24 @@
       <a-form-item label="收货人电话" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
       <a-form-item label="收货人电话" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
         <a-input
         <a-input
           id="network-edit-name"
           id="network-edit-name"
-          :maxLength="30"
+          :maxLength="11"
+          type="number"
           v-decorator="[
           v-decorator="[
-            'formData.name',
-            { initialValue: formData.name, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入收货人电话' }] }
+            'formData.receiverPhone',
+            { initialValue: formData.receiverPhone, getValueFromEvent: $filterEmpty, rules: [
+              { required: true, message: '请输入收货人电话' },
+              {pattern: /^[1][0-9]{10}$/, message: '请输入正确的收货人电话' }] }
           ]"
           ]"
           placeholder="请输入收货人电话"
           placeholder="请输入收货人电话"
           allowClear />
           allowClear />
       </a-form-item>
       </a-form-item>
-      <a-form-item label="省市区" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" required style="margin: 0;">
-        <a-row :gutter="20">
-          <!-- 地址 -->
-          <a-col span="8">
-            <a-form-item>
-              <a-select id="network-edit-provinceCode" @change="getCityList" v-decorator="['formData.provinceCode', { initialValue: formData.provinceCode, rules: [{ required: true, message: '请选择省' }] }]" placeholder="请选择省">
-                <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col span="8">
-            <a-form-item prop="cityCode">
-              <a-select id="network-edit-cityCode" v-decorator="['formData.cityCode', { initialValue: formData.cityCode, rules: [{ required: true, message: '请选择市' }] }]" @change="getAreaList" placeholder="请选择市">
-                <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col span="8">
-            <a-form-item prop="districtCode">
-              <a-select id="network-edit-districtCode" v-decorator="['formData.districtCode', { initialValue: formData.districtCode, rules: [{ required: true, message: '请选择区' }] }]" @change="areaCharged" placeholder="请选择区/县">
-                <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form-item>
-      <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="详细地址">
+      <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="收货人地址">
         <a-input
         <a-input
           id="network-edit-address"
           id="network-edit-address"
           :maxLength="30"
           :maxLength="30"
           v-decorator="[
           v-decorator="[
-            'formData.address',
-            { initialValue: formData.address, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入详细地址' }] }
+            'formData.receiveAddress',
+            { initialValue: formData.receiveAddress, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入详细地址' }] }
           ]"
           ]"
           placeholder="请输入详细地址(最多30个字符)"
           placeholder="请输入详细地址(最多30个字符)"
           allowClear />
           allowClear />
@@ -112,8 +89,8 @@
 
 
 <script>
 <script>
 import { VSelect } from '@/components'
 import { VSelect } from '@/components'
-import { stationSave, stationFind, getProvince, getCityByPro, getDistrictByCity } from '@/api/station'
-import { expressCompanyQuery } from '@/api/order'
+import { getLuckyDrawWinDetail } from '@/api/luckyDraw.js'
+import { expressCompanyQuery } from '@/api/order.js'
 export default {
 export default {
   name: 'GoodsLogistics',
   name: 'GoodsLogistics',
   components: { VSelect },
   components: { VSelect },
@@ -121,6 +98,11 @@ export default {
     openModal: { //  弹框显示状态
     openModal: { //  弹框显示状态
       type: Boolean,
       type: Boolean,
       default: false
       default: false
+    },
+    // 列id
+    itemId: {
+      type: String || Number,
+      default: ''
     }
     }
   },
   },
   data () {
   data () {
@@ -133,13 +115,9 @@ export default {
       formData: {
       formData: {
         expressName: undefined, //  快递公司
         expressName: undefined, //  快递公司
         expressNum: '', //  运单编号
         expressNum: '', //  运单编号
-        provinceCode: undefined, //  省
-        provinceName: '',
-        cityCode: undefined, // 市
-        cityName: '',
-        districtCode: undefined, // 区
-        districtName: '',
-        address: '' //  详细地址
+        receiverName: '', // 收货人名称
+        receiverPhone: '', // 收货人电话
+        receiveAddress: '' //  详细地址
       },
       },
       addrProvinceList: [], //  省下拉
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrCityList: [], //  市下拉
@@ -152,58 +130,6 @@ export default {
     this.getExpressCompany()
     this.getExpressCompany()
   },
   },
   methods: {
   methods: {
-    // 获取省列表'
-    getProvinceList () {
-      getProvince().then(res => {
-        if (res.status == 200) {
-          this.addrProvinceList = res.data || []
-        } else {
-          this.addrProvinceList = []
-        }
-      })
-    },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.form.setFieldsValue({ 'formData.cityCode': undefined })
-      this.form.setFieldsValue({ 'formData.districtCode': undefined })
-      this.form.setFieldsValue({ 'formData.address': '' })
-      this.getCityListRequest(val)
-    },
-    getCityListRequest (val) {
-      getCityByPro({
-        id: val
-      }).then(res => {
-        if (res.status == 200) {
-          this.addrCityList = res.data || []
-        } else {
-          this.addrCityList = []
-        }
-      })
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.form.setFieldsValue({ 'formData.districtCode': undefined })
-      this.form.setFieldsValue({ 'formData.address': '' })
-      this.getAreaListRequest(val)
-    },
-    getAreaListRequest (val) {
-      getDistrictByCity({
-        id: val
-      }).then(res => {
-        if (res.status == 200) {
-          this.addrDistrictList = res.data || []
-        } else {
-          this.addrDistrictList = []
-        }
-      })
-    },
-    // 区县变更
-    areaCharged (val) {
-      this.form.setFieldsValue({ 'formData.address': '' })
-    },
     //  物流信息  保存
     //  物流信息  保存
     handleSubmit (e) {
     handleSubmit (e) {
       e.preventDefault()
       e.preventDefault()
@@ -222,6 +148,15 @@ export default {
           this.expressCompany = []
           this.expressCompany = []
         }
         }
       })
       })
+    },
+    // 获取获奖用户信息
+    getCustomerInfo () {
+      getLuckyDrawWinDetail({ id: this.itemId }).then(res => {
+        if (res.status == 200) {
+          // console.log(res, 'rrrrrr')
+		  this.formData = Object.assign({}, res.data)
+        }
+      })
     }
     }
   },
   },
   watch: {
   watch: {
@@ -234,8 +169,10 @@ export default {
       if (!val) {
       if (!val) {
         this.$emit('close')
         this.$emit('close')
       } else {
       } else {
-        this.getProvinceList()
         this.form.resetFields()
         this.form.resetFields()
+        if (this.itemId) {
+          this.getCustomerInfo()
+        }
       }
       }
     }
     }
   }
   }

+ 32 - 155
src/views/market/GoodsLogisticsDetail.vue

@@ -4,7 +4,7 @@
     class="modalBox"
     class="modalBox"
     :footer="null"
     :footer="null"
     :maskClosable="false"
     :maskClosable="false"
-    title="查看详情"
+    title="发货"
     v-model="isShow"
     v-model="isShow"
     @cancle="isShow=false"
     @cancle="isShow=false"
     :width="1000">
     :width="1000">
@@ -16,113 +16,44 @@
       @submit="handleSubmit">
       @submit="handleSubmit">
       <h4>物流信息:</h4>
       <h4>物流信息:</h4>
       <a-form-item label="快递公司" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
       <a-form-item label="快递公司" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-        <a-select
-          id="logistics-expressName"
-          allowClear
-          v-decorator="[
-            'formData.expressName',
-            { initialValue: formData.expressName,
-              rules: [{ required: true, message: '请选择快递公司' }] },
-          ]"
-          placeholder="请选择快递公司"
-        >
-          <a-select-option v-for="(item,index) in expressCompany" :key="index" :value="item.expressName">
-            {{ item.expressName }}
-          </a-select-option>
-        </a-select>
+        <span>{{ formData.expressName }}</span>
       </a-form-item>
       </a-form-item>
       <a-form-item label="运单编号" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
       <a-form-item label="运单编号" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-        <a-input
-          id="logistics-expressNum"
-          :maxLength="30"
-          v-decorator="[
-            'formData.expressNum',
-            { initialValue: formData.expressNum, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入运单编号' }] }
-          ]"
-          placeholder="请输入运单编号(最多30个字符)"
-          allowClear />
+        <span>{{ formData.expressNum }}</span>
       </a-form-item>
       </a-form-item>
       <h4>收货人信息:</h4>
       <h4>收货人信息:</h4>
       <a-form-item label="收货人姓名" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
       <a-form-item label="收货人姓名" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-        <a-input
-          id="network-edit-name"
-          :maxLength="30"
-          v-decorator="[
-            'formData.name',
-            { initialValue: formData.name, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入收货人姓名' }] }
-          ]"
-          placeholder="请输入收货人姓名(最多30个字符)"
-          allowClear />
+        <span>{{ formData.receiverName }}</span>
       </a-form-item>
       </a-form-item>
       <a-form-item label="收货人电话" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
       <a-form-item label="收货人电话" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-        <a-input
-          id="network-edit-name"
-          :maxLength="30"
-          v-decorator="[
-            'formData.name',
-            { initialValue: formData.name, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入收货人电话' }] }
-          ]"
-          placeholder="请输入收货人电话"
-          allowClear />
+        <span>{{ formData.receiverPhone }}</span>
       </a-form-item>
       </a-form-item>
-      <a-form-item label="省市区" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" required style="margin: 0;">
-        <a-row :gutter="20">
-          <!-- 地址 -->
-          <a-col span="8">
-            <a-form-item>
-              <a-select id="network-edit-provinceCode" @change="getCityList" v-decorator="['formData.provinceCode', { initialValue: formData.provinceCode, rules: [{ required: true, message: '请选择省' }] }]" placeholder="请选择省">
-                <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col span="8">
-            <a-form-item prop="cityCode">
-              <a-select id="network-edit-cityCode" v-decorator="['formData.cityCode', { initialValue: formData.cityCode, rules: [{ required: true, message: '请选择市' }] }]" @change="getAreaList" placeholder="请选择市">
-                <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col span="8">
-            <a-form-item prop="districtCode">
-              <a-select id="network-edit-districtCode" v-decorator="['formData.districtCode', { initialValue: formData.districtCode, rules: [{ required: true, message: '请选择区' }] }]" @change="areaCharged" placeholder="请选择区/县">
-                <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-        </a-row>
+      <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="收货人地址">
+        <span>{{ formData.receiveAddress }}</span>
       </a-form-item>
       </a-form-item>
-      <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="详细地址">
-        <a-input
-          id="network-edit-address"
-          :maxLength="30"
-          v-decorator="[
-            'formData.address',
-            { initialValue: formData.address, getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入详细地址' }] }
-          ]"
-          placeholder="请输入详细地址(最多30个字符)"
-          allowClear />
-      </a-form-item>
-      <a-form-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+      <!-- <a-form-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+        <a-button type="primary" html-type="submit" id="logistics-submit" style="margin-right: 15px">保存</a-button>
         <a-button @click="isShow=false" style="margin-left: 15px" id="logistics-close">取消</a-button>
         <a-button @click="isShow=false" style="margin-left: 15px" id="logistics-close">取消</a-button>
-      </a-form-item>
+      </a-form-item> -->
     </a-form>
     </a-form>
   </a-modal>
   </a-modal>
 </template>
 </template>
 
 
 <script>
 <script>
 import { VSelect } from '@/components'
 import { VSelect } from '@/components'
-import { stationSave, stationFind, getProvince, getCityByPro, getDistrictByCity } from '@/api/station'
-import { expressCompanyQuery } from '@/api/order'
+import { getLuckyDrawWinDetail } from '@/api/luckyDraw.js'
+import { expressCompanyQuery } from '@/api/order.js'
 export default {
 export default {
-  name: 'GoodsLogisticsDetail',
+  name: 'GoodsLogistics',
   components: { VSelect },
   components: { VSelect },
   props: {
   props: {
     openModal: { //  弹框显示状态
     openModal: { //  弹框显示状态
       type: Boolean,
       type: Boolean,
       default: false
       default: false
     },
     },
-    recordId: { //  记录id
-      type: [Number, String],
+    // 列id
+    itemId: {
+      type: String || Number,
       default: ''
       default: ''
     }
     }
   },
   },
@@ -136,13 +67,9 @@ export default {
       formData: {
       formData: {
         expressName: undefined, //  快递公司
         expressName: undefined, //  快递公司
         expressNum: '', //  运单编号
         expressNum: '', //  运单编号
-        provinceCode: undefined, //  省
-        provinceName: '',
-        cityCode: undefined, // 市
-        cityName: '',
-        districtCode: undefined, // 区
-        districtName: '',
-        address: '' //  详细地址
+        receiverName: '', // 收货人名称
+        receiverPhone: '', // 收货人电话
+        receiveAddress: '' //  详细地址
       },
       },
       addrProvinceList: [], //  省下拉
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrCityList: [], //  市下拉
@@ -155,62 +82,6 @@ export default {
     this.getExpressCompany()
     this.getExpressCompany()
   },
   },
   methods: {
   methods: {
-    //  获取详情
-    getDetail () {
-
-    },
-    // 获取省列表
-    getProvinceList () {
-      getProvince().then(res => {
-        if (res.status == 200) {
-          this.addrProvinceList = res.data || []
-        } else {
-          this.addrProvinceList = []
-        }
-      })
-    },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.form.setFieldsValue({ 'formData.cityCode': undefined })
-      this.form.setFieldsValue({ 'formData.districtCode': undefined })
-      this.form.setFieldsValue({ 'formData.address': '' })
-      this.getCityListRequest(val)
-    },
-    getCityListRequest (val) {
-      getCityByPro({
-        id: val
-      }).then(res => {
-        if (res.status == 200) {
-          this.addrCityList = res.data || []
-        } else {
-          this.addrCityList = []
-        }
-      })
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.form.setFieldsValue({ 'formData.districtCode': undefined })
-      this.form.setFieldsValue({ 'formData.address': '' })
-      this.getAreaListRequest(val)
-    },
-    getAreaListRequest (val) {
-      getDistrictByCity({
-        id: val
-      }).then(res => {
-        if (res.status == 200) {
-          this.addrDistrictList = res.data || []
-        } else {
-          this.addrDistrictList = []
-        }
-      })
-    },
-    // 区县变更
-    areaCharged (val) {
-      this.form.setFieldsValue({ 'formData.address': '' })
-    },
     //  物流信息  保存
     //  物流信息  保存
     handleSubmit (e) {
     handleSubmit (e) {
       e.preventDefault()
       e.preventDefault()
@@ -229,6 +100,15 @@ export default {
           this.expressCompany = []
           this.expressCompany = []
         }
         }
       })
       })
+    },
+    // 获取获奖用户信息
+    getCustomerInfo () {
+      getLuckyDrawWinDetail({ id: this.itemId }).then(res => {
+        if (res.status == 200) {
+          this.formData = res.data
+		  // console.log(this.formData, 'lkllllllll')
+        }
+      })
     }
     }
   },
   },
   watch: {
   watch: {
@@ -240,14 +120,11 @@ export default {
     isShow (val) {
     isShow (val) {
       if (!val) {
       if (!val) {
         this.$emit('close')
         this.$emit('close')
-      } else {
-        this.getProvinceList()
         this.form.resetFields()
         this.form.resetFields()
-      }
-    },
-    recordId (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        this.getDetail()
+      } else {
+        if (this.itemId) {
+          this.getCustomerInfo()
+        }
       }
       }
     }
     }
   }
   }

+ 38 - 22
src/views/market/winingRecord.vue

@@ -16,7 +16,7 @@
           </a-col>
           </a-col>
           <a-col :span="5">
           <a-col :span="5">
             <a-form-item label="奖品" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
             <a-form-item label="奖品" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-              <a-input id="winRecord-customerMobile" allowClear v-model="queryParam.customerMobile" placeholder="请输入奖品名称" />
+              <a-input id="winRecord-prizeDesc" allowClear v-model="queryParam.prizeDesc" placeholder="请输入奖品名称" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="5">
           <a-col :span="5">
@@ -27,10 +27,10 @@
           <a-col :span="4">
           <a-col :span="4">
             <a-form-item label="状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
             <a-form-item label="状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
               <v-select
-                v-model="queryParam.orderState"
+                v-model="queryParam.state"
                 ref="orderState"
                 ref="orderState"
-                id="winRecord-status"
-                code="ORDER_STATE"
+                id="winRecord-state"
+                code="PRIZE_WIN_STATE"
                 placeholder="请选择状态"
                 placeholder="请选择状态"
                 allowClear></v-select>
                 allowClear></v-select>
             </a-form-item>
             </a-form-item>
@@ -55,21 +55,23 @@
           type="rocket"
           type="rocket"
           id="winRecord-sendGood"
           id="winRecord-sendGood"
           title="发货"
           title="发货"
+          v-if="record.prizeType=='GOODS'&&record.state=='WAIT_SEND_EXPRESS'"
           class="actionBtn icon-blues"
           class="actionBtn icon-blues"
           @click="sendGood(record)" />
           @click="sendGood(record)" />
         <a-icon
         <a-icon
           type="eye"
           type="eye"
           id="winRecord-handleView"
           id="winRecord-handleView"
           title="详情"
           title="详情"
+          v-if="record.prizeType=='GOODS'"
           class="actionBtn icon-green"
           class="actionBtn icon-green"
           @click="handleView(record)" />
           @click="handleView(record)" />
 
 
       </template>
       </template>
     </s-table>
     </s-table>
     <!-- 发货 -->
     <!-- 发货 -->
-    <GoodsLogistics :openModal="openModal" @submit="handleSubmit" @close="openModal=false" />
+    <GoodsLogistics :openModal="openModal" :itemId="itemId" @submit="handleSubmit" @close="openModal=false" />
     <!-- 发货详情 -->
     <!-- 发货详情 -->
-    <GoodsLogisticsDetail :openModal="openDetailModal" @close="openDetailModal=false" />
+    <GoodsLogisticsDetail :openModal="openDetailModal" :itemId="itemId" @close="openDetailModal=false" />
   </a-card>
   </a-card>
 
 
 </template>
 </template>
@@ -80,7 +82,7 @@ import GoodsLogistics from './GoodsLogistics.vue'
 import GoodsLogisticsDetail from './GoodsLogisticsDetail.vue'
 import GoodsLogisticsDetail from './GoodsLogisticsDetail.vue'
 import getDate from '@/libs/getDate.js'
 import getDate from '@/libs/getDate.js'
 import moment from 'moment'
 import moment from 'moment'
-import { orderList } from '@/api/order'
+import { getLuckyWinList, sendExpress } from '@/api/luckyDraw.js'
 export default {
 export default {
   name: 'WinRecord',
   name: 'WinRecord',
   components: { STable, VSelect, GoodsLogistics, GoodsLogisticsDetail },
   components: { STable, VSelect, GoodsLogistics, GoodsLogisticsDetail },
@@ -96,32 +98,34 @@ export default {
       queryParam: {
       queryParam: {
         beginDate: null, // 开始时间
         beginDate: null, // 开始时间
         endDate: null, // 结束时间
         endDate: null, // 结束时间
-        customerMobile: '', //  用户手机
-        orderSn: '', //  订单编号
-        orderState: null // 订单状态
+        prizeDesc: '', //  奖品
+        customerMobile: '', // 用户
+        state: '' // 状态
       },
       },
+	  itemId: '', // 发货列id
+	  luckyDrawWinNo: '', // 中奖奖品编码
       loading: false, // 导出loading
       loading: false, // 导出loading
       // 表头
       // 表头
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '中奖时间', dataIndex: 'orderTime', width: 200, align: 'center' },
-        { title: '活动名称', dataIndex: 'customerMobiles', align: 'center' },
-        { title: '奖品', dataIndex: 'orderSn', width: 200, align: 'center' },
+        { title: '中奖时间', dataIndex: 'winTime', width: 200, align: 'center' },
+        { title: '活动名称', dataIndex: 'activeName', width: 200, align: 'center' },
+        { title: '奖品', dataIndex: 'prizeDesc', width: 200, align: 'center' },
         { title: '中奖用户', dataIndex: 'customerMobile', width: 200, align: 'center' },
         { title: '中奖用户', dataIndex: 'customerMobile', width: 200, align: 'center' },
-        { title: '状态', dataIndex: 'orderStateDictValue', width: 200, align: 'center' },
+        { title: '状态', dataIndex: 'stateDictValue', width: 200, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         const searchData = Object.assign(parameter, this.queryParam)
         const searchData = Object.assign(parameter, this.queryParam)
         if (this.time && this.time.length) {
         if (this.time && this.time.length) {
-          searchData.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-          searchData.endDate = moment(this.time[1]).format('YYYY-MM-DD')
+          searchData.beginDate = moment(this.time[0]).format('YYYY-MM-DD 00:00:00')
+          searchData.endDate = moment(this.time[1]).format('YYYY-MM-DD 23:59:59')
         } else {
         } else {
           searchData.beginDate = ''
           searchData.beginDate = ''
           searchData.endDate = ''
           searchData.endDate = ''
         }
         }
-        return orderList(searchData).then(res => {
+        return getLuckyWinList(searchData).then(res => {
           if (res.status == 200) {
           if (res.status == 200) {
             const no = (res.data.pageNo - 1) * res.data.pageSize
             const no = (res.data.pageNo - 1) * res.data.pageSize
             for (let i = 0; i < res.data.list.length; i++) {
             for (let i = 0; i < res.data.list.length; i++) {
@@ -163,21 +167,33 @@ export default {
         moment(getDate.getToday().endtime, this.dateFormat)
         moment(getDate.getToday().endtime, this.dateFormat)
       ]
       ]
       this.queryParam.customerMobile = ''
       this.queryParam.customerMobile = ''
-      this.queryParam.orderSn = ''
-      this.queryParam.orderState = null
+      this.queryParam.prizeDesc = ''
+      this.queryParam.state = ''
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
     //  查看物流详情
     //  查看物流详情
     handleView (row) {
     handleView (row) {
+      this.itemId = row.id
       this.openDetailModal = true
       this.openDetailModal = true
     },
     },
     // 发货
     // 发货
-    sendGood () {
+    sendGood (row) {
+      this.itemId = row.id
+	  this.luckyDrawWinNo = row.luckyDrawWinNo
       this.openModal = true
       this.openModal = true
     },
     },
     // 提交发货
     // 提交发货
-    handleSubmit () {
-
+    handleSubmit (data) {
+      console.log(data, 'ppppppp')
+	  const params = data
+	  params.luckyDrawWinNo = this.luckyDrawWinNo
+	  sendExpress(params).then(res => {
+		  if (res.status == 200) {
+			  this.openModal = false
+			  this.$message.success(res.message)
+			  this.$refs.table.refresh(true)
+		  }
+	  })
     }
     }
   }
   }
 }
 }