Explorar el Código

1、问题处理

yys hace 1 mes
padre
commit
c524041dd5

+ 0 - 35
build/index.js

@@ -1,35 +0,0 @@
-const { run } = require('runjs')
-const chalk = require('chalk')
-const config = require('../vue.config.js')
-const rawArgv = process.argv.slice(2)
-const args = rawArgv.join(' ')
-
-if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
-  const report = rawArgv.includes('--report')
-
-  run(`vue-cli-service build ${args}`)
-
-  const port = 9526
-  const publicPath = config.publicPath
-
-  var connect = require('connect')
-  var serveStatic = require('serve-static')
-  const app = connect()
-
-  app.use(
-    publicPath,
-    serveStatic('./dist', {
-      index: ['index.html', '/']
-    })
-  )
-
-  app.listen(port, function () {
-    console.log(chalk.green(`> Preview at  http://localhost:${port}${publicPath}`))
-    if (report) {
-      console.log(chalk.green(`> Report at  http://localhost:${port}${publicPath}report.html`))
-    }
-
-  })
-} else {
-  run(`vue-cli-service build ${args}`)
-}

+ 17 - 0
src/api/course/userCourseCategory.js

@@ -83,3 +83,20 @@ export function getCateListByPid(pid) {
     method: 'get'
   })
 }
+
+// 导出导入失败信息
+export function exportFail(data) {
+  return request({
+    url: '/course/userCourseCategory/exportFail',
+    method: 'post',
+    data: data
+  })
+}
+
+// 下载导入模板
+export function importTemplate() {
+  return request({
+    url: '/course/userCourseCategory/importTemplate',
+    method: 'get'
+  })
+}

+ 1 - 1
src/api/his/vessel.js

@@ -25,7 +25,7 @@ export function getVessel(id) {
 // 下载导入模板
 export function importTemplate() {
   return request({
-    url: '/his/questions/importTemplate',
+    url: '/his/vessel/importTemplate',
     method: 'get'
   })
 }

+ 19 - 6
src/views/his/hospital/index.vue

@@ -262,7 +262,7 @@
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
         </el-form-item>
-        <el-form-item label="省市区" >
+        <el-form-item label="省市区" prop="cityIds">
           <el-cascader
           ref="citySelect"
           v-model="form.cityIds"
@@ -523,6 +523,13 @@ export default {
 
     },
    handleCityChange(value) {
+     if (!value || !value.length) {
+       this.form.cityIds = null;
+       this.form.province = null;
+       this.form.city = null;
+       this.form.district = null;
+       return;
+     }
      var nodes=this.$refs.citySelect.getCheckedNodes();
      this.form.cityIds=value.toString();
      this.form.province=nodes[0].pathLabels[0];
@@ -635,18 +642,24 @@ export default {
         this.form = response.data;
         this.open = true;
         this.title = "修改医院";
-        this.form.hospitalType = String(this.form.hospitalType)
-        this.form.status = String(this.form.status)
-        this.form.hospitalLevel = String(this.form.hospitalLevel)
-           this.form.cityIds=((this.form.cityIds).split(",")).map(Number)
+        this.form.hospitalType = this.form.hospitalType != null ? String(this.form.hospitalType) : null
+        this.form.status = this.form.status != null ? String(this.form.status) : null
+        this.form.hospitalLevel = this.form.hospitalLevel != null ? String(this.form.hospitalLevel) : null
+           if (this.form.cityIds) {
+             this.form.cityIds=((this.form.cityIds).split(",")).map(Number)
+           }
 
       });
     },
     /** 提交按钮 */
     submitForm() {
-              this.form.cityIds=(this.form.cityIds).toString()
       this.$refs["form"].validate(valid => {
         if (valid) {
+          if (this.form.cityIds != null) {
+            this.form.cityIds = Array.isArray(this.form.cityIds)
+              ? this.form.cityIds.join(',')
+              : String(this.form.cityIds);
+          }
           if (this.form.hospitalId != null) {
             updateHospital(this.form).then(response => {
               this.msgSuccess("修改成功");

+ 1 - 1
src/views/his/vessel/index.vue

@@ -269,7 +269,7 @@
 </template>
 
 <script>
-import { listVessel, getVessel, delVessel, addVessel, updateVessel, exportVessel } from "@/api/his/vessel";
+import { listVessel, getVessel, delVessel, addVessel, updateVessel, exportVessel, importTemplate } from "@/api/his/vessel";
 import vesselDetails from '../../components/his/vesselDetails.vue';
 import Editor from '@/components/Editor/wang';
 import { getToken } from "@/utils/auth";

+ 1 - 1
src/views/hisStore/store/index.vue

@@ -1,4 +1,4 @@
-<template xmlns:el-col="http://www.w3.org/1999/html">
+  <template xmlns:el-col="http://www.w3.org/1999/html">
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="店铺名称" prop="storeName">

+ 66 - 10
src/views/hisStore/storeProduct/index.vue

@@ -38,7 +38,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="所属公司">
-        <el-select style="width: 240px" v-model="companyId" multiple placeholder="请选择企业" clearable size="small" >
+          <el-select style="width: 240px" v-model="companyId" multiple placeholder="请选择企业" clearable size="small" >
           <el-option
             v-for="item in companyOptions"
             :key="item.companyId"
@@ -870,13 +870,34 @@
           </el-select>
         </el-form-item>
         <el-form-item label="所属小程序" prop="appIds">
-          <el-select style="width: 240px" v-model="appIds" placeholder="请选择所属小程序" clearable size="small" multiple>
+          <el-select
+            style="width: 240px"
+            v-model="appIds"
+            placeholder="请选择所属小程序"
+            clearable
+            size="small"
+            multiple
+            filterable
+            @visible-change="handleAppMallVisibleChange"
+          >
             <el-option
               v-for="dict in appMallOptions"
               :key="dict.appid"
               :label="dict.name + '(' + dict.appid + ')'"
               :value="dict.appid"
             />
+            <div style="padding: 10px; text-align: center;">
+              <el-button
+                v-if="appMallOptions.length < appMallTotal"
+                type="text"
+                size="small"
+                :loading="appMallLoading"
+                @click="loadMoreAppMall"
+              >
+                加载更多
+              </el-button>
+              <span v-else style="color: #999; font-size: 12px;">已加载全部</span>
+            </div>
           </el-select>
         </el-form-item>
         <el-form-item label="退货地址" prop="returnAddress">
@@ -1075,6 +1096,12 @@ export default {
       // 小程序列表
       appMallOptions:[],
       appIds:[], // 选择的小程序
+      appMallQueryParams: {
+        pageNum: 1,
+        pageSize: 30
+      },
+      appMallTotal: 0,
+      appMallLoading: false,
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -1227,8 +1254,8 @@ export default {
     getCompanyList().then(response => {
       this.companyOptions = response.data;
     });
-    // 查询小程序
-    this.getAppMallOptions();
+    // 查询小程序(首次加载30条)
+    this.getAppMallOptions(true);
 
     listStore(this.storeForm).then(response => {
       this.storeOptions = response.rows;
@@ -1237,10 +1264,34 @@ export default {
     this.getList();
   },
   methods: {
-    getAppMallOptions() {
-      getAppMallOptions({pageNum:1,pageSize:100}).then(response => {
-        this.appMallOptions = response.rows;
-      })
+    getAppMallOptions(reset = false) {
+      if (reset) {
+        this.appMallQueryParams.pageNum = 1;
+        this.appMallOptions = [];
+      }
+      this.appMallLoading = true;
+      getAppMallOptions(this.appMallQueryParams).then(response => {
+        const newRows = response.rows || [];
+        this.appMallTotal = response.total || 0;
+        if (reset) {
+          this.appMallOptions = newRows;
+        } else {
+          this.appMallOptions = [...this.appMallOptions, ...newRows];
+        }
+        this.appMallLoading = false;
+      }).catch(() => {
+        this.appMallLoading = false;
+      });
+    },
+    loadMoreAppMall() {
+      this.appMallQueryParams.pageNum++;
+      this.getAppMallOptions(false);
+    },
+    handleAppMallVisibleChange(visible) {
+      // 下拉框打开时,如果没有数据则重新加载
+      if (visible && this.appMallOptions.length === 0) {
+        this.getAppMallOptions(true);
+      }
     },
     getStatusText(row) {
       console.log()
@@ -1577,13 +1628,18 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.queryParams.companyIds = this.companyId +''
+      this.queryParams.pageNum = 1
+      if (this.companyId){
+        this.queryParams.companyIds = this.companyId +''
+      }
       this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      this.companyId = null;
+      this.queryParams.companyIds = null;
+      this.queryParams.storeIds = null;
       this.handleQuery();
     },
     // 多选框选中数据