Browse Source

Merge branch 'deploy_hy1.0' of http://git.chelingzhu.com/chelingzhu-web/zxyj-admin-html into deploy_hy1.0

lilei 4 years ago
parent
commit
a642ccfc21
2 changed files with 278 additions and 10 deletions
  1. 258 0
      src/views/market/GoodsLogisticsDetail.vue
  2. 20 10
      src/views/market/winingRecord.vue

+ 258 - 0
src/views/market/GoodsLogisticsDetail.vue

@@ -0,0 +1,258 @@
+<template>
+  <a-modal
+    centered
+    class="modalBox"
+    :footer="null"
+    :maskClosable="false"
+    title="查看详情"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="1000">
+    <a-form
+      id="logistics-form"
+      :form="form"
+      ref="form"
+      v-bind="formItemLayout"
+      @submit="handleSubmit">
+      <h4>物流信息:</h4>
+      <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>
+      </a-form-item>
+      <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 />
+      </a-form-item>
+      <h4>收货人信息:</h4>
+      <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 />
+      </a-form-item>
+      <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 />
+      </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-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-button @click="isShow=false" style="margin-left: 15px" id="logistics-close">取消</a-button>
+      </a-form-item>
+    </a-form>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { stationSave, stationFind, getProvince, getCityByPro, getDistrictByCity } from '@/api/station'
+import { expressCompanyQuery } from '@/api/order'
+export default {
+  name: 'GoodsLogisticsDetail',
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    recordId: { //  记录id
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      form: this.$form.createForm(this),
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      formData: {
+        expressName: undefined, //  快递公司
+        expressNum: '', //  运单编号
+        provinceCode: undefined, //  省
+        provinceName: '',
+        cityCode: undefined, // 市
+        cityName: '',
+        districtCode: undefined, // 区
+        districtName: '',
+        address: '' //  详细地址
+      },
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [], //  区下拉
+      isShow: this.openModal, //  是否填写物流信息
+      expressCompany: [] //  快递公司
+    }
+  },
+  mounted () {
+    this.getExpressCompany()
+  },
+  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) {
+      e.preventDefault()
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.$emit('submit', values.formData)
+        }
+      })
+    },
+    //  获取快递公司
+    getExpressCompany () {
+      expressCompanyQuery({}).then(res => {
+        if (res.status == 200) {
+          this.expressCompany = res.data
+        } else {
+          this.expressCompany = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (val) {
+      if (!val) {
+        this.$emit('close')
+      } else {
+        this.getProvinceList()
+        this.form.resetFields()
+      }
+    },
+    recordId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+</style>

+ 20 - 10
src/views/market/winingRecord.vue

@@ -14,9 +14,14 @@
                 @change="onChange" />
             </a-form-item>
           </a-col>
-          <a-col :span="6">
-            <a-form-item label="奖品名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-              <a-input id="winRecord-customerMobile" allowClear :maxLength="11" v-model="queryParam.customerMobile" placeholder="请输入奖品名称" />
+          <a-col :span="5">
+            <a-form-item label="奖品" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <a-input id="winRecord-customerMobile" allowClear v-model="queryParam.customerMobile" placeholder="请输入奖品名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="5">
+            <a-form-item label="用户" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <a-input id="winRecord-customerMobile" allowClear v-model="queryParam.customerMobile" placeholder="请输入用户账号" />
             </a-form-item>
           </a-col>
           <a-col :span="4">
@@ -30,7 +35,7 @@
                 allowClear></v-select>
             </a-form-item>
           </a-col>
-          <a-col :span="6">
+          <a-col :span="4">
             <a-button class="handle-btn serach-btn" id="winRecord-btn-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
             <a-button class="handle-btn" type="" id="winRecord-btn-reset" @click="handleReset">重置</a-button>
           </a-col>
@@ -61,8 +66,10 @@
 
       </template>
     </s-table>
-    <!-- 物流信息 -->
+    <!-- 发货 -->
     <GoodsLogistics :openModal="openModal" @submit="handleSubmit" @close="openModal=false" />
+    <!-- 发货详情 -->
+    <GoodsLogisticsDetail :openModal="openDetailModal" @close="openDetailModal=false" />
   </a-card>
 
 </template>
@@ -70,18 +77,20 @@
 <script>
 import { STable, VSelect } from '@/components'
 import GoodsLogistics from './GoodsLogistics.vue'
+import GoodsLogisticsDetail from './GoodsLogisticsDetail.vue'
 import getDate from '@/libs/getDate.js'
 import moment from 'moment'
 import { orderList } from '@/api/order'
 export default {
   name: 'WinRecord',
-  components: { STable, VSelect, GoodsLogistics },
+  components: { STable, VSelect, GoodsLogistics, GoodsLogisticsDetail },
   data () {
     return {
       openModal: false, //  是否填写物流信息
+      openDetailModal: false, //  是否查看物流信息
       formItemLayout: {
-        labelCol: { span: 7 },
-        wrapperCol: { span: 17 }
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
       },
       // 查询参数
       queryParam: {
@@ -96,7 +105,7 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '中奖时间', dataIndex: 'orderTime', width: 200, align: 'center' },
-        { title: '活动名称', dataIndex: 'customerMobile', align: 'center' },
+        { title: '活动名称', dataIndex: 'customerMobiles', align: 'center' },
         { title: '奖品', dataIndex: 'orderSn', width: 200, align: 'center' },
         { title: '中奖用户', dataIndex: 'customerMobile', width: 200, align: 'center' },
         { title: '状态', dataIndex: 'orderStateDictValue', width: 200, align: 'center' },
@@ -160,7 +169,7 @@ export default {
     },
     //  查看物流详情
     handleView (row) {
-      this.$router.push({ path: `/order/orderManage/detail/${row.id}` })
+      this.openDetailModal = true
     },
     // 发货
     sendGood () {
@@ -185,6 +194,7 @@ export default {
       }
       .handle-btn{
         margin-top: 4px;
+        margin-bottom: 20px;
       }
       .serach-btn{
         margin-right: 10px;