Explorar o código

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI

xgb hai 3 semanas
pai
achega
03494824f9

+ 58 - 0
src/api/hisStore/integralGoods.js

@@ -0,0 +1,58 @@
+import request from '@/utils/request'
+
+// 查询积分商品列表
+export function listIntegralGoods(query) {
+  return request({
+    url: '/his/integralGoods/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询积分商品详细
+export function getIntegralGoods(goodsId) {
+  return request({
+    url: '/his/integralGoods/' + goodsId,
+    method: 'get'
+  })
+}
+export function importTemplate() {
+  return request({
+    url: '/his/integralGoods/importTemplate',
+    method: 'get'
+  })
+}
+// 新增积分商品
+export function addIntegralGoods(data) {
+  return request({
+    url: '/his/integralGoods',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改积分商品
+export function updateIntegralGoods(data) {
+  return request({
+    url: '/his/integralGoods',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除积分商品
+export function delIntegralGoods(goodsId) {
+  return request({
+    url: '/his/integralGoods/' + goodsId,
+    method: 'delete'
+  })
+}
+
+// 导出积分商品
+export function exportIntegralGoods(query) {
+  return request({
+    url: '/his/integralGoods/export',
+    method: 'get',
+    params: query
+  })
+}

+ 8 - 0
src/views/company/companyUser/index.vue

@@ -118,6 +118,14 @@
           <el-table-column label="员工后台昵称" align="center" prop="nickName" :show-overflow-tooltip="true" 员工后台  width="100"/>
           <el-table-column label="部门" align="center" prop="deptName" :show-overflow-tooltip="true" />
           <el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
+          <el-table-column label="账户角色" align="center" :show-overflow-tooltip="true" width="150">
+            <template slot-scope="scope">
+              <span v-if="scope.row.roleNames && scope.row.roleNames.length > 0">
+                {{ scope.row.roleNames.join('、') }}
+              </span>
+              <span v-else>-</span>
+            </template>
+          </el-table-column>
           <el-table-column label="二维码" align="center" prop="qrCodeWeixin">
             <template slot-scope="scope">
               <!-- 显示已上传的二维码 -->

+ 623 - 0
src/views/hisStore/integralOrder/addOrder.vue

@@ -0,0 +1,623 @@
+<template>
+  <div class="app-container">
+    <!-- 添加一个加载状态,在获取createOrderType之前显示 -->
+    <div v-if="!formReady" style="text-align: center; padding: 50px;">
+      <i class="el-icon-loading"></i> 正在加载...
+    </div>
+
+    <!-- 只有在formReady为true时才显示表单 -->
+    <el-form v-if="formReady" ref="form" :model="form" :rules="rules" label-width="120px">
+      <el-form-item label="会员信息" prop="userId">
+        <el-table border style="margin-top:5px;" v-loading="userloading" :data="users">
+          <el-table-column label="ID" align="center" prop="userId" />
+          <el-table-column label="会员头像" align="center" width="80">
+            <template slot-scope="scope">
+              <el-popover placement="right" title="" trigger="hover">
+                <img slot="reference" :src="scope.row.avatar" width="50">
+                <img :src="scope.row.avatar" style="max-width: 120px;">
+              </el-popover>
+            </template>
+          </el-table-column>
+          <el-table-column label="昵称" align="center" prop="nickname" />
+          <el-table-column label="手机号" align="center" prop="phone" />
+          <el-table-column label="状态" align="center" prop="status">
+            <template slot-scope="scope">
+              <el-tag prop="status" v-for="(item, index) in userStatusOptions" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+
+      <el-form-item label="收货信息" prop="addressId">
+        <el-row>
+          <el-col>
+            <el-button plain type="primary" icon="el-icon-plus" @click="handleAddUserAddress()">添加收货地址</el-button>
+          </el-col>
+        </el-row>
+        <el-radio-group v-model="form.addressId" style="width:100%">
+          <el-table border style="margin-top:5px;" v-loading="addressloading" :data="address">
+            <el-table-column label="ID" align="center"  >
+              <template slot-scope="scope">
+                <el-radio :label="scope.row.addressId"></el-radio>
+              </template>
+            </el-table-column>
+            <el-table-column label="收货人姓名" align="center" prop="realName" />
+            <el-table-column label="收货人电话" align="center" prop="phone" />
+            <el-table-column label="地址" align="center" prop="detail">
+              <template slot-scope="scope">
+                {{scope.row.province}} {{scope.row.city}} {{scope.row.district}} {{scope.row.detail}}
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-radio-group>
+      </el-form-item>
+
+      <el-form-item label="商品列表">
+        <el-row>
+          <el-col>
+            <el-button plain type="primary" icon="el-icon-plus" @click="handleAddProduct">添加商品</el-button>
+          </el-col>
+        </el-row>
+        <el-table border :key="tablekey" width="100%" style="margin-top:5px;" :data="products">
+          <el-table-column label="商品名称" align="center" prop="goodsName" />
+          <el-table-column label="商品图片" align="center" width="100">
+            <template slot-scope="scope">
+              <el-popover placement="right" title="" trigger="hover">
+                <img slot="reference" :src="scope.row.imgUrl" width="50">
+                <img :src="scope.row.imgUrl" style="max-width: 50px;">
+              </el-popover>
+            </template>
+          </el-table-column>
+          <el-table-column label="库存" align="center" prop="stock" />
+          <el-table-column label="所需积分" align="center" prop="integral" />
+          <el-table-column label="需支付金额" align="center" prop="cash" />
+          <el-table-column label="商品编号" align="center" prop="barCode" />
+
+          <el-table-column label="操作" align="center" width="100px">
+            <template slot-scope="scope">
+              <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+      </el-form-item>
+      <el-form-item label="订单备注" prop="mark">
+        <el-input type="textarea" rows="2" v-model="form.mark" placeholder="" />
+      </el-form-item>
+    </el-form>
+
+    <div v-if="formReady" slot="footer" class="dialog-footer" style="float: right; margin-bottom: 20px;">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="cancel">取 消</el-button>
+    </div>
+
+    <!-- 对话框部分保持不变 -->
+    <el-dialog :title="product.title" v-if="product.open" :visible.sync="product.open" width="1000px" append-to-body>
+      <product-select @selectProduct="selectProduct" />
+    </el-dialog>
+    <el-dialog :title="user.title" v-if="user.open" :visible.sync="user.open" width="500px" append-to-body>
+      <add-user @addUser="addUser" />
+    </el-dialog>
+    <el-dialog :title="userAddress.title" v-if="userAddress.open" :visible.sync="userAddress.open" width="800px" append-to-body>
+      <add-user-address ref="addUserAddress" @addUserAddress="addUserAddress" />
+    </el-dialog>
+    <el-dialog :title="payQr.title" v-if="payQr.open" :visible.sync="payQr.open" width="240px" append-to-body>
+      <div style="padding-bottom:15px;">
+        <div class="qrcode" ref="qrCodeUrl"></div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { addIntegralOrder } from "@/api/hisStore/integralOrder";
+import { getUserList } from "@/api/users/user";
+import { getAddressList } from "@/api/users/userAddress";
+import { getTcmScheduleList } from "@/api/company/tcmScheduleReport";
+import productSelect from "@/views/hisStore/integralOrder/integralProductSelect";
+import addUserAddress from "@/views/hisStore/components/addUserAddress";
+import config from "@/utils/config";
+import QRCode from 'qrcodejs2'
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  components: { Treeselect,productSelect,addUserAddress },
+  name: "StoreOrder",
+  props: {
+    customerId: {
+      type: Number,
+      required: false
+    },
+    userId: {
+      type: Number,
+      required: false
+    }
+  },
+  data() {
+    return {
+      // 添加表单准备状态
+      formReady: false,
+      createOrderType: null,
+      // 部门树选项
+      deptOptions: undefined,
+      // 部门名称
+      deptName: undefined,
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+      deliveryPayStatusOptions:[],
+      deliveryStatusOptions:[],
+      dateRange: [],
+      orderTypeOptions:[],
+      orderMediumOptions:[],
+      payTypeOptions:[],
+      payQr:{
+        open:false,
+        title:"付款二维码"
+      },
+      user:{
+        open:false,
+        title:"创建会员"
+      },
+      userAddress:{
+        open:false,
+        title:"创建收货地址"
+      },
+      tablekey:false,
+      totalMoney:0.00,
+      products:[],
+      product:{
+        open:false,
+        title:"商品选择"
+      },
+      phone:null,
+      address:[],
+      addressloading: false,
+      userloading: false,
+      users:[],
+      userStatusOptions:[],
+      show:{
+        open:false,
+        title:"订单详情"
+      },
+      activeName:"00",
+      statusOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单表格数据
+      storeOrderList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      createTimeRange:[],
+      payTimeRange:[],
+      deliveryImportTimeRange:[],
+      scheduleOptions:[],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderCode: null,
+        extendOrderId: null,
+        userId: null,
+        realName: null,
+        userPhone: null,
+        userAddress: null,
+        cartId: null,
+        freightPrice: null,
+        totalNum: null,
+        totalPrice: null,
+        totalPostage: null,
+        payPrice: null,
+        payPostage: null,
+        deductionPrice: null,
+        couponId: null,
+        couponPrice: null,
+        paid: null,
+        payTime: null,
+        payType: null,
+        status: null,
+        refundStatus: null,
+        refundReasonWapImg: null,
+        refundReasonWapExplain: null,
+        refundReasonTime: null,
+        refundReasonWap: null,
+        refundReason: null,
+        refundPrice: null,
+        deliverySn: null,
+        deliveryName: null,
+        deliveryType: null,
+        deliveryId: null,
+        gainIntegral: null,
+        useIntegral: null,
+        payIntegral: null,
+        backIntegral: null,
+        mark: null,
+        isDel: null,
+        cost: null,
+        verifyCode: null,
+        storeId: null,
+        shippingType: null,
+        isChannel: null,
+        isRemind: null,
+        isSysDel: null
+      },
+      // 表单参数
+      form: {
+        addressId:null,
+        userId:null,
+        products:[],
+      },
+      // 表单校验
+      rules: {
+        userId: [
+          { required: true, message: "会员信息不能为空", trigger: "submit" }
+        ],
+        addressId: [
+          { required: true, message: "收货信息不能为空", trigger: "submit" }
+        ],
+        products: [
+          { required: true, message: "商品不能为空", trigger: "submit" }
+        ],
+      }
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+  created() {
+    // 先获取createOrderType,然后再初始化其他数据
+    this.initializeForm();
+  },
+  methods: {
+    // 初始化表单的方法
+    async initializeForm() {
+      try {
+
+        // 2. 然后并行加载其他数据
+        await Promise.all([
+          this.loadDictionaries(),
+          this.loadOtherData(),
+          this.initUser()
+        ]);
+
+        // 3. 所有数据加载完成后,设置表单为准备状态
+        this.formReady = true;
+        console.log('Form is ready to display');
+
+      } catch (error) {
+        console.error('Error initializing form:', error);
+        this.$message.error('表单初始化失败');
+      }
+    },
+
+    // 加载字典数据
+    async loadDictionaries() {
+      const dictPromises = [
+        this.getDicts("crm_customer_source").then((response) => {
+          this.orderMediumOptions = response.data;
+        }),
+        this.getDicts("store_order_type").then((response) => {
+          this.orderTypeOptions = response.data;
+        }),
+        this.getDicts("store_pay_type").then((response) => {
+          this.payTypeOptions = response.data;
+        }),
+        this.getDicts("user_status").then((response) => {
+          this.userStatusOptions = response.data;
+        }),
+        this.getDicts("store_order_status").then((response) => {
+          this.statusOptions = response.data;
+        }),
+        this.getDicts("store_order_delivery_status").then((response) => {
+          this.deliveryStatusOptions = response.data;
+        }),
+        this.getDicts("store_delivery_pay_status").then((response) => {
+          this.deliveryPayStatusOptions = response.data;
+        })
+      ];
+
+      await Promise.all(dictPromises);
+    },
+
+    // 加载其他数据
+    async loadOtherData() {
+      await Promise.all([
+        this.getTreeselect(),
+        getTcmScheduleList().then(response => {
+          this.scheduleOptions = response.data;
+        })
+      ]);
+    },
+
+    initUser(){
+      return new Promise((resolve) => {
+        if(this.userId != null){
+          var data={userId:this.userId}
+          this.userloading = true;
+          this.users=[];
+          this.address=[];
+          getUserList(data).then(response => {
+            this.users = response.data;
+            this.userloading = false;
+            if(this.users!=null&&this.users.length==1){
+              this.form.userId=this.users[0].userId;
+              this.getAddressList(this.form.userId).then(() => {
+                resolve();
+              });
+            } else {
+              resolve();
+            }
+          }).catch(() => {
+            resolve();
+          });
+        } else {
+          resolve();
+        }
+      });
+    },
+
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      return treeselect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+
+    // 修改getAddressList方法,返回Promise
+    getAddressList(userId){
+      var data={userId:userId}
+      this.addressloading = true;
+      this.address=[];
+      return getAddressList(data).then(response => {
+        this.address = response.data;
+        this.addressloading = false;
+      });
+    },
+
+    // 其他方法保持不变...
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.deptId = data.id;
+      this.getList();
+    },
+    handleGenPayUrl(row){
+      this.payQr.open=true;
+      setTimeout(() => {
+        var qrcode = new QRCode(this.$refs.qrCodeUrl, {
+            text: config.payQRUrl+row.id,
+            width: 200,
+            height: 200,
+            colorDark: '#000000',
+            colorLight: '#ffffff',
+            correctLevel: QRCode.CorrectLevel.H
+        })
+      }, 200);
+    },
+    handleAddUser(){
+      this.user.open=true;
+    },
+    handleAddUserAddress(){
+      this.userAddress.open=true;
+      setTimeout(() => {
+        this.$refs.addUserAddress.init(this.form.userId);
+      }, 500);
+    },
+    addUserAddress(){
+      this.userAddress.open=false;
+      //获取地址
+      this.getAddressList(this.form.userId);
+    },
+    addUser(){
+      this.user.open=false;
+    },
+    compute(){
+      this.totalMoney=0;
+      var that=this;
+      this.products.forEach (function (value) {
+          that.totalMoney += value.money;
+      });
+    },
+    handleProductCountChange(row){
+      this.tablekey = !this.tablekey
+      row.money=row.count*row.price;
+      this.$forceUpdate();
+      this.compute();
+    },
+
+    selectProduct(row){
+      for(var i=0;i<this.products.length;i++){
+        if(this.products[i].id==row.id){
+          return;
+        }
+      }
+      row.count=1;
+      row.money=row.count*row.price;
+      this.products.push(row);
+      this.$message.success("商品"+ row.goodsName + "添加成功")
+      this.compute();
+    },
+    handleAddProduct(){
+      this.product.open=true;
+    },
+    searchUser(){
+      if(this.phone==null||this.phone==""){
+        return;
+      }
+      var data={phone:this.phone}
+      this.userloading = true;
+      this.users=[];
+      this.address=[];
+      getUserList(data).then(response => {
+        this.users = response.data;
+        this.userloading = false;
+        if(this.users!=null&&this.users.length==1){
+          this.form.userId=this.users[0].userId;
+          this.getAddressList(this.form.userId)
+        }
+      });
+    },
+    handleDetails(row){
+      this.show.open=true;
+      const orderId = row.id ;
+      setTimeout(() => {
+        this.$refs.order.getOrder(orderId);
+      }, 500);
+    },
+    handleClick(tab, event) {
+       if(tab.name=="all"){
+        this.queryParams.status==null;
+      }
+      else{
+         this.queryParams.status=tab.name;
+      }
+      this.getList();
+    },
+    /** 查询订单列表 */
+    getList() {
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+      this.loading = true;
+
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+      this.$emit("closePackage")
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        addressId:null,
+        userId:null,
+        products:null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "创建订单";
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if(this.products.length==0){
+          this.msgError("请选择商品");
+          return;
+        }
+        this.form.products=this.products;
+        if (valid) {
+          this.form.goodsId = this.form.products[0].goodsId;
+          // console.log("this.form:{}",this.form.products[0].goodsId)
+          addIntegralOrder(this.form).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("创建成功");
+              this.$emit("closePackage")
+            }
+          });
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+       this.products.splice(this.products.findIndex(item => item.id === row.id), 1)
+       this.compute();
+    },
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.items{
+  margin: 5px 0px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: flex-start;
+  .pic{
+    width:60px;
+    height:60px;
+  }
+  .goods-content{
+    margin-left: 10px;
+    max-width: 200px;
+    text-align: left;
+    .goods-title{
+      overflow:hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+      -o-text-overflow:ellipsis;
+    }
+  }
+}
+.el-message-box__message p{
+  max-height: 400px;
+  overflow:scroll;
+}
+.import-msg{
+  height: 500px;
+  overflow: auto;
+}
+</style>
+
+<style>
+.el-descriptions-item__label.is-bordered-label{
+  font-weight: normal;
+}
+</style>

+ 111 - 0
src/views/hisStore/integralOrder/integralProductSelect.vue

@@ -0,0 +1,111 @@
+<template>
+  <div >
+    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
+      <el-form-item label="商品名称" prop="goodsName">
+        <el-input
+          style="width:200px"
+          v-model="queryParams.goodsName"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table border v-loading="loading" :data="list">
+      <el-table-column label="商品图片" align="center" width="100">
+        <template slot-scope="scope">
+          <el-popover
+            placement="right"
+            title=""
+            trigger="hover"
+          >
+            <img slot="reference" :src="scope.row.imgUrl" width="80">
+            <img :src="scope.row.imgUrl" style="max-width: 80px;">
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="商品分类" align="center" prop="goodType">
+        <template slot-scope="scope">
+          <dict-tag :options="typeOptions" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="goodsName" />
+      <el-table-column label="库存" align="center" prop="stock" />
+      <el-table-column label="所需积分" align="center" prop="integral" />
+      <el-table-column label="需支付金额" align="center" prop="cash" />
+      <el-table-column label="商品编号" align="center" prop="barCode" />
+
+      <el-table-column label="操作" align="center" width="100px" >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleSelect(scope.row)"
+          >选择</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      style="padding-bottom:10px;"
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listIntegralGoods } from "@/api/hisStore/integralGoods";
+export default {
+  name: "selectProduct",
+  data() {
+    return {
+      loading: true,
+      list:[],
+      typeOptions:[],
+      total: 0,
+      queryParams: {
+        goodsName:"",
+        pageNum: 1,
+        pageSize: 10
+      }
+    };
+  },
+  created() {
+     this.getList();
+
+    this.getDicts("sys_integral_goods_type").then(response => {
+      this.typeOptions = response.data;
+    });
+
+  },
+
+  methods: {
+    handleSelect(row){
+      this.$emit('selectProduct',row);
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    getList(){
+      this.loading = true;
+      listIntegralGoods(this.queryParams).then(response => {
+        this.list = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    }
+  }
+};
+</script>
+<style scoped>
+
+</style>

+ 1 - 0
src/views/qw/contactWay/index.vue

@@ -110,6 +110,7 @@
         </el-row>
         <div style=" height: calc(100% - 40px); overflow-y: auto;">
           <el-table v-loading="loading" :data="contactWayList" @selection-change="handleSelectionChange" border>
+            <el-table-column label="id" align="center" prop="id" />
             <el-table-column label="名称" align="center" prop="name" />
             <el-table-column label="二维码" align="center" prop="qrCode" width="150px" >
               <template slot-scope="scope">

+ 13 - 0
src/views/qw/externalContact/index.vue

@@ -20,6 +20,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="活码id" prop="wayId">
+        <el-input
+          v-model="queryParams.wayId"
+          placeholder="请输入活码id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
 
       <el-form-item label="销售企微昵称" prop="qwUserName">
         <el-input
@@ -382,6 +391,9 @@
           <dict-tag :options="ratingType" :value="scope.row.level"/>
         </template>
       </el-table-column>
+
+      <el-table-column label="state参数" align="center" prop="state" width="100px" />
+
       <el-table-column label="等级状态" align="center" prop="levelType" width="120px" >
         <template slot-scope="scope">
           <dict-tag :options="ratingUpFall" :value="scope.row.levelType"/>
@@ -960,6 +972,7 @@ export default {
         eTime:null,
         createTime:null,
         level:null,
+        wayId:null,
         levelType:null,
         companyUser:null
       },

+ 302 - 264
src/views/store/components/userDetailsTemp.vue

@@ -1,282 +1,320 @@
 <template>
-    <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
-      <div class="contentx" v-if="item!=null" >
-        <div class="desct">
-          基本信息
-        </div>
-            <el-descriptions title="" :column="3" border>
-    
-              <el-descriptions-item label="会员id" >
-                    <span v-if="item!=null">{{item.userId}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="用户昵称" >
-                    <span v-if="item!=null">{{item.nickName}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="用户头像" >
-                     <el-image v-if="item.avatar!=null"
-                              style="width: 50px;"
-                              :src="item.avatar">
-                          </el-image>
-                </el-descriptions-item>
-                <el-descriptions-item label="手机号码" >
-                    <span v-if="item!=null">{{item.phone}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="用户积分" >
-                    <span v-if="item!=null">{{item.integral}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="状态" >
+  <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
+    <div class="contentx" v-if="item!=null" >
+      <div class="desct">
+        基本信息
+      </div>
+      <el-descriptions title="" :column="3" border>
+
+        <el-descriptions-item label="会员id" >
+          <span v-if="item!=null">{{item.userId}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="用户昵称" >
+          <span v-if="item!=null">{{item.nickName}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="用户头像" >
+          <el-image v-if="item.avatar!=null"
+                    style="width: 50px;"
+                    :src="item.avatar">
+          </el-image>
+        </el-descriptions-item>
+        <el-descriptions-item label="手机号码" >
+          <span v-if="item!=null">{{item.phone}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="用户积分" >
+          <span v-if="item!=null">{{item.integral}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="状态" >
                  <span v-if="item!=null">
                        <dict-tag :options="userOptions" :value="item.status"/>
                  </span>
-                </el-descriptions-item>
-    
-                <el-descriptions-item label="上级昵称" >
-                    <span v-if="item!=null">{{item.tuiName}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="上级手机号码" >
-                    <span v-if="item!=null">{{item.tuiPhone}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="推广员关联时间" >
-                    <span v-if="item!=null">{{item.tuiTime}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="下级人数" >
-                    <span v-if="item!=null">{{item.tuiUserCount}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="最后一次登录ip" >
-                    <span v-if="item!=null">{{item.lastIp}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="余额" >
-                    <span v-if="item!=null">{{item.balance}}</span>
-                </el-descriptions-item>
-                <el-descriptions-item label="创建时间" >
-                    <span v-if="item!=null">{{item.createTime}}</span>
-                </el-descriptions-item>
-    
-                <el-descriptions-item label="更新时间" >
-                    <span v-if="item!=null">{{item.updateTime}}</span>
-                </el-descriptions-item>
-            </el-descriptions>
+        </el-descriptions-item>
+
+        <el-descriptions-item label="上级昵称" >
+          <span v-if="item!=null">{{item.tuiName}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="上级手机号码" >
+          <span v-if="item!=null">{{item.tuiPhone}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="推广员关联时间" >
+          <span v-if="item!=null">{{item.tuiTime}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="下级人数" >
+          <span v-if="item!=null">{{item.tuiUserCount}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="最后一次登录ip" >
+          <span v-if="item!=null">{{item.lastIp}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="余额" >
+          <span v-if="item!=null">{{item.balance}}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="创建时间" >
+          <span v-if="item!=null">{{item.createTime}}</span>
+        </el-descriptions-item>
+
+        <el-descriptions-item label="更新时间" >
+          <span v-if="item!=null">{{item.updateTime}}</span>
+        </el-descriptions-item>
+      </el-descriptions>
+    </div>
+    <!-- 积分记录 -->
+    <div class="contentx" v-if="item!=null" >
+      <div class="desct" style="display: flex; justify-content: space-between; align-items: center;">
+        <span>用户积分记录</span>
+        <el-button type="primary" @click="handleIntegralPurchase">积分购</el-button>
+      </div>
+      <userIntegralDetails  ref="userIntegralDetail" />
+    </div>
+
+    <div class="contentx" v-if="item!=null">
+      <div class="desct"> 优惠劵领取信息</div>
+      <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
+        <el-tab-pane label="全部" name="10"></el-tab-pane>
+        <el-tab-pane v-for="(item,index) in couponStatusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
+      </el-tabs>
+      <el-table v-loading="loading" :data="userCouponList">
+        <el-table-column label="优惠劵标题" align="center" prop="title" />
+        <el-table-column label="券号" align="center" prop="couponCode" />
+        <el-table-column label="会员昵称" align="center" prop="nickName" />
+        <el-table-column label="会员电话" align="center" prop="phone" />
+        <el-table-column label="关联订单ID" align="center" prop="businessId" />
+        <el-table-column label="订单类型" align="center" prop="businessType">
+          <template slot-scope="scope">
+            <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
+          </template>
+        </el-table-column>
+        <el-table-column label="状态" align="center" prop="status">
+          <template slot-scope="scope">
+            <dict-tag :options="couponStatusOptions" :value="scope.row.status"/>
+          </template>
+        </el-table-column>
+        <el-table-column label="领取时间" align="center" prop="createTime" width="180"/>
+        <el-table-column label="使用时间" align="center" prop="useTime" width="180"/>
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
     </div>
-    
-        <div class="contentx" v-if="item!=null">
-                <div class="desct"> 优惠劵领取信息</div>
-                <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
-                  <el-tab-pane label="全部" name="10"></el-tab-pane>
-                  <el-tab-pane v-for="(item,index) in couponStatusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
-                </el-tabs>
-                <el-table v-loading="loading" :data="userCouponList">
-                  <el-table-column label="优惠劵标题" align="center" prop="title" />
-                  <el-table-column label="券号" align="center" prop="couponCode" />
-                  <el-table-column label="会员昵称" align="center" prop="nickName" />
-                  <el-table-column label="会员电话" align="center" prop="phone" />
-                  <el-table-column label="关联订单ID" align="center" prop="businessId" />
-                  <el-table-column label="订单类型" align="center" prop="businessType">
-                    <template slot-scope="scope">
-                      <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="状态" align="center" prop="status">
-                    <template slot-scope="scope">
-                      <dict-tag :options="couponStatusOptions" :value="scope.row.status"/>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="领取时间" align="center" prop="createTime" width="180"/>
-                  <el-table-column label="使用时间" align="center" prop="useTime" width="180"/>
-                </el-table>
-                <pagination
-                  v-show="total>0"
-                  :total="total"
-                  :page.sync="queryParams.pageNum"
-                  :limit.sync="queryParams.pageSize"
-                  @pagination="getList"
-                />
-            </div>
-    
-    
-    
-      <div class="contentx" v-if="item!=null">
-            <div class="desct">
+
+    <div class="contentx" v-if="item!=null">
+      <div class="desct">
               <span v-if="patientInfo">
                 {{ patientInfo }}
               </span>
-              <span v-else>
+        <span v-else>
                 患者信息
               </span>
-            </div>
-        <userPatietDetails  ref="userPatietDetail" />
-    
       </div>
-    
-      <div class="contentx" v-if="item!=null" >
-     <div class="desct">
-          用户地址
-     </div>
-     <userAddDetails  ref="userAddDetail" />
-    
-       </div>
-      <div class="contentx" v-if="item!=null" >
-     <div class="desct">
-          用户药品订单
-     </div>
-        <userStorerDetails  ref="userDetails" />
-       </div>
+      <userPatietDetails  ref="userPatietDetail" />
+
+    </div>
+
     <div class="contentx" v-if="item!=null" >
-     <div class="desct">
-          用户问诊订单
-     </div>
-        <userInquiryOrderDetails  ref="InquiryDetails" />
+      <div class="desct">
+        用户地址
+      </div>
+      <userAddDetails  ref="userAddDetail" />
 
-        
-       </div>
-      <!-- 积分记录 -->
-      <div class="contentx" v-if="item!=null" >
-        <div class="desct">
-              用户积分记录
-        </div>
-            <userIntegralDetails  ref="userIntegralDetail" />
+    </div>
+    <div class="contentx" v-if="item!=null" >
+      <div class="desct">
+        用户药品订单
       </div>
+      <userStorerDetails  ref="userDetails" />
+    </div>
+    <div class="contentx" v-if="item!=null" >
+      <div class="desct">
+        用户问诊订单
+      </div>
+      <userInquiryOrderDetails  ref="InquiryDetails" />
+    </div>
 
+    <!-- 积分购弹窗 -->
+    <el-dialog
+      title="积分购"
+      :visible.sync="integralPurchaseVisible"
+      width="60%"
+      append-to-body
+    >
+      <!-- 积分购弹窗 -->
+      <add-order-dialog
+        :key="currentUserId + '-' + refreshKey"
+        :userId="currentUserId"
+        @closePackage="integralPurchaseVisible = false"
+      />
 
-     </div>
-    </template>
-    
-    
-    
-    <script>
-    import { listPatient, getPatient, delPatient, addPatient, updatePatient, exportPatient ,getPatientByUserId} from "@/api/store/patient";
-    import { listUser, getUser, delUser, addUser, updateUser, exportUser ,getUserAddr} from "@/api/store/user";
-    import { getListUserCoupon } from "@/api/store/userCoupon";
-    import userStorerDetails from "../components/userStorerDetails.vue";
-    import userPatietDetails from "../components/userPatietDetails.vue";
-    import userInquiryOrderDetails from "../components/userInquiryOrderDetails.vue";
-    import userAddDetails from "../components/userAddDetails.vue";
-    import userIntegralDetails from "../components/userIntegralDetails.vue";
-      export default {
-        name: "storedet",
-        props:["data"],
-         components: { userStorerDetails ,userInquiryOrderDetails,userPatietDetails,userAddDetails,userIntegralDetails},
-        data() {
-          return {
-            patientInfo: process.env.VUE_APP_PATIENT_INFO,
-            addr:[],
-            patient:[],
-            userOptions: [],
-            statusOptions: [],
-            sexOptions: [],
-            pOptions: [],
-            item:null,
-            total: 0,
-            loading: true,
-           // 会员优惠券表格数据
-            userCouponList: [],
-            queryParams: {
-             pageNum: 1,
-             pageSize: 10,
-             userId: null,
-             couponId: null,
-            },
-            actName:"10",
-            businessTypeOptions:[],
-            couponStatusOptions:[],
-          }
-        },
-        created() {
-          this.getDicts("sys_user_status").then(response => {
-            this.userOptions = response.data;
-          });
-          this.getDicts("sys_company_status").then(response => {
-            this.statusOptions = response.data;
-          });
-          this.getDicts("sys_patient_status").then(response => {
-           this.pOptions = response.data;
-          });
-          this.getDicts("sys_patient_sex").then(response => {
-             this.sexOptions = response.data;
-           });
-           this.getDicts("sys_coupon_business_type").then(response => {
-             this.businessTypeOptions = response.data;
-           });
-    
-           this.getDicts("sys_coupon_status").then(response => {
-             this.couponStatusOptions = response.data;
-           });
-        },
-        methods: {
-          handleClickX(tab, event) {
-           if(tab.name=="10"){
-             this.queryParams.status=null;
-           }else{
-             this.queryParams.status=tab.name;
-           }
-              this.queryParams.pageNum = 1;
-              this.getList();
-    
-          },
-          getList() {
-            this.loading = true;
-            getListUserCoupon(this.queryParams).then(response => {
-              this.userCouponList = response.rows;
-              this.total = response.total;
-              this.loading = false;
-            });
-          },
-          getDetails(orderId) {
-              this.item=null;
-              getUser(orderId).then(response => {
-                  this.item = response.data;
-                  setTimeout(() => {
-                       this.$refs.userDetails.getUserDetails(orderId);
-                  }, 1);
-                  setTimeout(() => {
-                       this.$refs.InquiryDetails.getInquiryDetails(orderId,1);
-                  }, 1);
-                  setTimeout(() => {
-                       this.$refs.userPatietDetail.getPatList(orderId);
-                  }, 1);
-                  setTimeout(() => {
-                       this.$refs.userAddDetail.getAddList(orderId);
-                  }, 1);
-                  setTimeout(() => {
-                       this.$refs.userIntegralDetail.getIntegralLogs(orderId);
-                  }, 1);
-    
-              });
-              this.patient=null;
-              getPatientByUserId(orderId).then(response => {
-                  this.patient = response.data;
-              });
-              getUserAddr(orderId).then(response => {
-                  this.addr = response.data;
-              });
-               this.queryParams.userId=orderId;
-              this.getList();
-    
-          },
-        }
-      }
-    </script>
-    <style>
-    
-      .contentx{
-          height: 100%;
-          background-color: #fff;
-          padding: 0px 20px 20px;
-    
-    
-          margin: 20px;
-      }
-      .el-descriptions-item__label.is-bordered-label{
-        font-weight: normal;
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listPatient, getPatient, delPatient, addPatient, updatePatient, exportPatient ,getPatientByUserId} from "@/api/store/patient";
+import { listUser, getUser, delUser, addUser, updateUser, exportUser ,getUserAddr} from "@/api/store/user";
+import { getListUserCoupon } from "@/api/store/userCoupon";
+import userStorerDetails from "../components/userStorerDetails.vue";
+import userPatietDetails from "../components/userPatietDetails.vue";
+import userInquiryOrderDetails from "../components/userInquiryOrderDetails.vue";
+import userAddDetails from "../components/userAddDetails.vue";
+import userIntegralDetails from "../components/userIntegralDetails.vue";
+import AddOrderDialog from "../../hisStore/integralOrder/addOrder.vue"; // 导入积分购组件
+
+export default {
+  name: "storedet",
+  props:["data"],
+  components: {
+    userStorerDetails,
+    userInquiryOrderDetails,
+    userPatietDetails,
+    userAddDetails,
+    userIntegralDetails,
+    AddOrderDialog // 注册积分购组件
+  },
+  data() {
+    return {
+      refreshKey: 0, // 每次点击刷新用
+      patientInfo: process.env.VUE_APP_PATIENT_INFO,
+      addr:[],
+      patient:[],
+      userOptions: [],
+      statusOptions: [],
+      sexOptions: [],
+      pOptions: [],
+      item:null,
+      total: 0,
+      loading: true,
+      // 积分购相关
+      integralPurchaseVisible: false,
+      currentUserId: null,
+      // 会员优惠券表格数据
+      userCouponList: [],
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        couponId: null,
+      },
+      actName:"10",
+      businessTypeOptions:[],
+      couponStatusOptions:[],
+    }
+  },
+  created() {
+    this.getDicts("sys_user_status").then(response => {
+      this.userOptions = response.data;
+    });
+    this.getDicts("sys_company_status").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("sys_patient_status").then(response => {
+      this.pOptions = response.data;
+    });
+    this.getDicts("sys_patient_sex").then(response => {
+      this.sexOptions = response.data;
+    });
+    this.getDicts("sys_coupon_business_type").then(response => {
+      this.businessTypeOptions = response.data;
+    });
+
+    this.getDicts("sys_coupon_status").then(response => {
+      this.couponStatusOptions = response.data;
+    });
+  },
+  methods: {
+    // 积分购相关方法
+    handleIntegralPurchase() {
+      if (this.item && this.item.userId) {
+        this.currentUserId = this.item.userId;
+        this.refreshKey++; // 每次点击都强制刷新
+        this.integralPurchaseVisible = true;
+      } else {
+        this.$message.warning('无法获取用户信息');
       }
-      .el-descriptions-item__content {
-        max-width: 150px;
-        min-width: 100px;
+    },
+
+    handleCloseIntegralPurchase() {
+      this.integralPurchaseVisible = false;
+      this.currentUserId = null;
+    },
+
+    handleClickX(tab, event) {
+      if(tab.name=="10"){
+        this.queryParams.status=null;
+      }else{
+        this.queryParams.status=tab.name;
       }
-      .desct{
-          padding-top: 20px;
-          padding-bottom: 20px;
-          color: #524b4a;
-          font-weight: bold;
-        }
-    </style>
-    
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+
+    getList() {
+      this.loading = true;
+      getListUserCoupon(this.queryParams).then(response => {
+        this.userCouponList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+    getDetails(orderId) {
+      this.item=null;
+      getUser(orderId).then(response => {
+        this.item = response.data;
+        setTimeout(() => {
+          this.$refs.userDetails.getUserDetails(orderId);
+        }, 1);
+        setTimeout(() => {
+          this.$refs.InquiryDetails.getInquiryDetails(orderId,1);
+        }, 1);
+        setTimeout(() => {
+          this.$refs.userPatietDetail.getPatList(orderId);
+        }, 1);
+        setTimeout(() => {
+          this.$refs.userAddDetail.getAddList(orderId);
+        }, 1);
+        setTimeout(() => {
+          this.$refs.userIntegralDetail.getIntegralLogs(orderId);
+        }, 1);
+      });
+
+      this.patient=null;
+      getPatientByUserId(orderId).then(response => {
+        this.patient = response.data;
+      });
+
+      getUserAddr(orderId).then(response => {
+        this.addr = response.data;
+      });
+
+      this.queryParams.userId=orderId;
+      this.getList();
+    },
+  }
+}
+</script>
+
+<style>
+.contentx{
+  height: 100%;
+  background-color: #fff;
+  padding: 0px 20px 20px;
+  margin: 20px;
+}
+.el-descriptions-item__label.is-bordered-label{
+  font-weight: normal;
+}
+.el-descriptions-item__content {
+  max-width: 150px;
+  min-width: 100px;
+}
+.desct{
+  padding-top: 20px;
+  padding-bottom: 20px;
+  color: #524b4a;
+  font-weight: bold;
+}
+</style>