Browse Source

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

caoliqin 1 week ago
parent
commit
b24a354b37

+ 61 - 0
src/api/his/answer.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询问答列表
+export function listAnswer(query) {
+  return request({
+    url: '/his/answer/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询问答详细
+export function getAnswer(id) {
+  return request({
+    url: '/his/answer/' + id,
+    method: 'get'
+  })
+}
+
+// 新增问答
+export function addAnswer(data) {
+  return request({
+    url: '/his/answer',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改问答
+export function updateAnswer(data) {
+  return request({
+    url: '/his/answer',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除问答
+export function delAnswer(id) {
+  return request({
+    url: '/his/answer/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出问答
+export function exportAnswer(query) {
+  return request({
+    url: '/his/answer/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 问答列表选项
+export function questionOptions() {
+  return request({
+    url: '/his/answer/allList',
+    method: 'get',
+  })
+}

+ 0 - 1
src/views/components/his/storeOrderDetails.vue

@@ -472,7 +472,6 @@
                         :precision="2" 
                         :step="0.1" 
                         :min="0"
-                        :max="scope.row.price"    
                         size="mini"
                       />
                     </template>

+ 525 - 0
src/views/his/answer/index.vue

@@ -0,0 +1,525 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
+          v-hasPermi="['his:answer:add']">新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
+          v-hasPermi="['his:answer:edit']">修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
+          v-hasPermi="['his:answer:remove']">删除</el-button>
+      </el-col>
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['his:answer:export']"
+        >导出</el-button>
+      </el-col> -->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="answerList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="问答名称" align="center" prop="questionName" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
+            v-hasPermi="['his:answer:edit']">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
+            v-hasPermi="['his:answer:remove']">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+
+    <!-- 添加或修改问答对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
+        <el-form-item label="问答名称" prop="questionName">
+          <el-input v-model="form.questionName" placeholder="请输入内容" />
+        </el-form-item>
+        <div v-if="form.answers && form.answers.length == 0" class="empty-state">
+          <div class="empty-state-icon">
+            <i class="el-icon-document"></i>
+          </div>
+          <p>暂无问题,请点击下方按钮添加</p>
+        </div>
+
+        <div v-for="(answer, index) in form.answers" :key="index" class="answer-section">
+          <div class="answer-section-header">
+            <span class="answer-section-title">
+              <span class="answer-section-number">{{ index + 1 }}</span>
+              问题 {{ index + 1 }}
+            </span>
+            <div>
+              <el-button 
+                v-if="index !== 0" 
+                type="danger" 
+                size="mini" 
+                icon="el-icon-delete"
+                @click="delItem(answer, index)">
+                删除问题
+              </el-button>
+            </div>
+          </div>
+          
+          <el-row :gutter="15">
+            <el-col :span="16">
+              <el-form-item label="问题标题" :prop="`answers[${index}].title`" :rules="rules.title">
+                <el-input v-model="answer.title" placeholder="请输入问题标题"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          
+          <el-form-item label="选项配置">
+            <div v-for="(option, optionIndex) in answer.options" :key="optionIndex" class="option-item">
+              <div class="option-input">
+                <el-input 
+                  v-model="answer.options[optionIndex]" 
+                  :placeholder="`选项 ${optionIndex + 1}`">
+                </el-input>
+              </div>
+              <div class="option-actions">
+                <el-button 
+                  v-if="optionIndex + 1 === answer.options.length"
+                  type="primary" 
+                  size="mini" 
+                  icon="el-icon-plus"
+                  circle
+                  @click="addOption(index, optionIndex)">
+                </el-button>
+                <el-button 
+                  v-if="optionIndex !== 0"
+                  type="danger" 
+                  size="mini" 
+                  icon="el-icon-minus"
+                  circle
+                  @click="delOption(answer.options, optionIndex)">
+                </el-button>
+              </div>
+            </div>
+            <div class="option-tip">
+              <span>提示:至少保留一个选项,点击 + 按钮添加更多选项</span>
+            </div>
+          </el-form-item>
+        </div>
+        
+        <div class="add-section-btn">
+          <el-button 
+            type="primary" 
+            icon="el-icon-plus"
+            @click="addItem(form.answers.length)">
+            添加问题
+          </el-button>
+        </div>
+        
+        <!-- <div v-for="(i, index) in form.answers" :key="index">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="标题" prop="title">
+                <el-input v-model="i.title"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-button style="margin: 5px;" v-if="index + 1 == form.answers.length"
+                @click="addItem(form.answers.length)" type="primary" size="mini">+</el-button>
+              <el-button style="margin: 5px;" v-if="index !== 0" type="danger" size="mini"
+                @click="delItem(i, index)">-</el-button>
+            </el-col>
+
+          </el-row>
+        </div> -->
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listAnswer, getAnswer, delAnswer, addAnswer, updateAnswer, exportAnswer } from "@/api/his/answer";
+
+export default {
+  name: "Answer",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 问答表格数据
+      answerList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        jsonInfo: null,
+      },
+      form: {
+            questionName: '',
+            answers: [
+              {
+                title: '',
+                options: ['']
+              }
+            ]
+          },
+          rules: {
+            questionName: [
+              { required: true, message: '请输入问答名称', trigger: 'blur' }
+            ],
+            title: [
+              { required: true, message: '请输入问题标题', trigger: 'blur' }
+            ]
+          }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    addItem(length) {
+          this.form.answers.push({
+            title: '',
+            options: ['']
+          })
+        },
+        delItem(item, index) {
+          if (this.form.answers.length > 1) {
+            this.$confirm('确定要删除这个问题吗?', '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+            }).then(() => {
+              this.form.answers.splice(index, 1)
+              this.$message({
+                type: 'success',
+                message: '删除成功!'
+              });
+            }).catch(() => {
+              this.$message({
+                type: 'info',
+                message: '已取消删除'
+              });          
+            });
+          } else {
+            this.$message.warning('至少保留一个问题')
+          }
+        },
+        addOption(answerIndex, optionIndex) {
+          this.form.answers[answerIndex].options.push('')
+        },
+        delOption(options, index) {
+          if (options.length > 1) {
+            this.$confirm('确定要删除这个选项吗?', '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+            }).then(() => {
+              options.splice(index, 1)
+              this.$message({
+                type: 'success',
+                message: '删除成功!'
+              });
+            }).catch(() => {
+              this.$message({
+                type: 'info',
+                message: '已取消删除'
+              });          
+            });
+          } else {
+            this.$message.warning('至少保留一个选项')
+          }
+        },
+    // addItem(length) {
+    //   this.form.answers.push({
+    //     title: '',
+    //     options: [],
+    //   })
+    // },
+    // delItem(item, index) {
+    //   this.form.answers.splice(index, 1)
+    // },
+    // addItem1(length,n) {
+    //   this.form.answers[n].options.push('')
+    // },
+    // delItem2(item, index) {
+    //   this.form.answers.splice(index, 1)
+    // },
+    /** 查询问答列表 */
+    getList() {
+      this.loading = true;
+      listAnswer(this.queryParams).then(response => {
+        this.answerList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        jsonInfo: null,
+        createTime: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加问答";
+      if (this.form.answers == null) {
+        this.form = {
+          answers: [{
+            title: '',
+            options: ['']
+          }
+
+          ]
+        }
+      }
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAnswer(id).then(response => {
+        this.form = response.data;
+        if (this.form.answers == null) {
+          this.form = {
+            answers: [{
+              title: '',
+              options: []
+            }
+
+            ]
+          }
+        }
+        this.form.questionName = response.data.questionName;
+        this.form.id = response.data.id;
+        this.open = true;
+        this.title = "修改问答";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.answers) {
+            this.form.jsonInfo = JSON.stringify(this.form.answers);
+          }
+          if (this.form.id != null) {
+            updateAnswer(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAnswer(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除问答编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delAnswer(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => { });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有问答数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportAnswer(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => { });
+    }
+  }
+};
+</script>
+<style>
+    .form-container {
+      max-width: 900px;
+      margin: 30px auto;
+      padding: 25px;
+      background: #fff;
+      border-radius: 10px;
+      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
+    }
+    .form-header {
+      margin-bottom: 25px;
+      padding-bottom: 15px;
+      border-bottom: 1px solid #ebeef5;
+    }
+    .form-header h2 {
+      margin: 0;
+      color: #303133;
+      font-size: 22px;
+    }
+    .form-header p {
+      margin: 8px 0 0;
+      color: #606266;
+      font-size: 14px;
+    }
+    .answer-section {
+      margin: 25px 0;
+      padding: 20px;
+      border: 1px solid #e6e9f0;
+      border-radius: 8px;
+      background-color: #f9fafc;
+      transition: all 0.3s ease;
+    }
+    .answer-section:hover {
+      border-color: #c0c4cc;
+      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+    }
+    .answer-section-header {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      margin-bottom: 20px;
+      padding-bottom: 12px;
+      border-bottom: 1px dashed #dcdfe6;
+    }
+    .answer-section-title {
+      font-weight: 600;
+      color: #303133;
+      font-size: 16px;
+    }
+    .answer-section-number {
+      display: inline-flex;
+      align-items: center;
+      justify-content: center;
+      width: 24px;
+      height: 24px;
+      background: #409EFF;
+      color: white;
+      border-radius: 50%;
+      font-size: 12px;
+      margin-right: 8px;
+    }
+    .option-item {
+      display: flex;
+      align-items: center;
+      margin-bottom: 12px;
+    }
+    .option-input {
+      flex: 1;
+    }
+    .option-actions {
+      margin-left: 10px;
+      display: flex;
+      gap: 5px;
+    }
+    .section-actions {
+      display: flex;
+      justify-content: flex-end;
+      margin-top: 20px;
+    }
+    .add-section-btn {
+      margin-top: 15px;
+      text-align: center;
+    }
+    .el-form-item {
+      margin-bottom: 20px;
+    }
+    .el-col {
+      padding-right: 15px;
+    }
+    .el-col:last-child {
+      padding-right: 0;
+    }
+    .option-tip {
+      margin-top: 10px;
+      color: #909399;
+      font-size: 12px;
+    }
+    .empty-state {
+      text-align: center;
+      padding: 30px;
+      color: #909399;
+    }
+    .empty-state-icon {
+      font-size: 48px;
+      margin-bottom: 15px;
+      color: #c0c4cc;
+    }
+  </style>
+

+ 15 - 0
src/views/his/package/index.vue

@@ -569,6 +569,16 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="问答" prop="questionId" >
+           <el-select v-model="form.questionId" placeholder="请选择问答">
+              <el-option
+                  v-for="dict in questionOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="parseInt(dict.dictValue)"
+                />
+           </el-select>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -653,6 +663,7 @@ import {
 import {getAllFollowTempName } from "@/api/his/followTemp";
 import {getAllCateList} from "@/api/his/packageCate";
 import {allIcd } from "@/api/his/icd";
+import {questionOptions } from "@/api/his/answer";
 import packageDetails from '../../components/his/packageDetails.vue';
 import productAttrValueSelect from "../../components/his/productAttrValueSelect.vue";
 import { listStore } from "@/api/his/storeProduct";
@@ -702,6 +713,7 @@ export default {
               url: process.env.VUE_APP_BASE_API + "/his/package/importData"
             },
       productTypeOptions: [],
+      questionOptions: [],
       storeId:null,
       storeOPtions:[],
       usageFrequencyUnitOptions:[{
@@ -856,6 +868,9 @@ export default {
     listStore().then(response => {
       this.storeOPtions = response.rows;
     });
+    questionOptions().then(res => {
+      this.questionOptions = res.rows;
+    })
   },
   methods: {
     getSolarTermLabel(solarTerm) {

+ 2 - 1
src/views/his/storeOrder/order1.vue

@@ -1563,7 +1563,6 @@ export default {
           this.executeCreateErpOrder();
         });
       }
-      this.getList();
     },
 
     async executSetErpOrder() {
@@ -1614,6 +1613,7 @@ export default {
           this.$message.success('订单ERP账号设置成功');
           this.cancelErpAccountDialog();
           this.getErpAccountList(); // 刷新列表
+          this.getList();
         } else {
           this.$message.error(response.msg || 'ERP账号设置失败');
         }
@@ -1674,6 +1674,7 @@ export default {
           this.$message.success('ERP订单创建成功');
           this.cancelErpAccountDialog();
           this.getErpAccountList(); // 刷新列表
+          this.getList();
         } else {
           this.$message.error(response.msg || 'ERP订单创建失败');
         }

+ 10 - 0
src/views/hisStore/storeOrder/index.vue

@@ -296,6 +296,16 @@
               <span v-if="scope.row.payPrice!=null">{{scope.row.payPrice.toFixed(2)}}</span>
           </template>
       </el-table-column>
+      <el-table-column label="实付金额" align="center" prop="payMoney" >
+          <template slot-scope="scope">
+              <span v-if="scope.row.payPrice!=null">{{scope.row.payMoney.toFixed(2)}}</span>
+          </template>
+      </el-table-column>
+      <el-table-column label="物流代收金额" align="center" prop="payDelivery" >
+          <template slot-scope="scope">
+              <span v-if="scope.row.payPrice!=null">{{scope.row.payDelivery.toFixed(2)}}</span>
+          </template>
+      </el-table-column>
       <el-table-column label="下单时间" align="center" prop="createTime" />
       <!-- <el-table-column label="支付状态" align="center" prop="paid" /> -->
       <el-table-column label="支付时间" align="center" prop="payTime" width="180">

+ 7 - 1
src/views/system/config/config.vue

@@ -1453,7 +1453,13 @@
                inactive-color="#ff4949">
              </el-switch>
            </el-form-item>
-
+          <el-form-item label="是否开启企微二维码" prop="showQwCode">
+            <el-switch
+              v-model="form18.showQwCode"
+              active-color="#13ce66"
+              inactive-color="#ff4949">
+            </el-switch>
+          </el-form-item>
           <div class="line"></div>
           <div style="float:right;margin-right:20px">
             <el-button type="primary" @click="submitForm18">提交</el-button>

+ 10 - 1
src/views/system/user/index.vue

@@ -146,6 +146,14 @@
           <el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
           <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
           <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
+          <el-table-column label="账户角色" align="center" key="roleName" v-if="columns[7].visible" :show-overflow-tooltip="true">
+            <template slot-scope="scope">
+              <span v-if="scope.row.roleName && scope.row.roleName.length > 0">
+                {{ Array.isArray(scope.row.roleName) ? scope.row.roleName.join('、') : scope.row.roleName }}
+              </span>
+              <span v-else>-</span>
+            </template>
+          </el-table-column>
           <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
             <template slot-scope="scope">
               <el-switch
@@ -434,7 +442,8 @@ export default {
         { key: 3, label: `部门`, visible: true },
         { key: 4, label: `手机号码`, visible: true },
         { key: 5, label: `状态`, visible: true },
-        { key: 6, label: `创建时间`, visible: true }
+        { key: 6, label: `创建时间`, visible: true },
+        { key: 7, label: `账户角色`, visible: true }
       ],
       // 表单校验
       rules: {