wangtao 3 роки тому
батько
коміт
0bac3a46b9

+ 9 - 1
src/api/system/product.js

@@ -31,7 +31,7 @@ export function listChannel(query) {
         params: query
     })
 }
-// 上传文件查询(充值)
+// 查询文件管理
 export function listRecharge(data) {
     return request({
         url: '/sysFile/page',
@@ -39,6 +39,14 @@ export function listRecharge(data) {
         data
     })
 }
+// 上传文件查询(充值表格)
+export function uploadFile(data) {
+    return request({
+        url: '/dxtop/order/addOrderByFile',
+        method: 'post',
+        data
+    })
+}
 
 
 //图片上传获取四步曲

+ 102 - 94
src/assets/styles/index.scss

@@ -4,189 +4,197 @@
 @import './element-ui.scss';
 @import './sidebar.scss';
 @import './btn.scss';
-
 body {
-  height: 100%;
-  -moz-osx-font-smoothing: grayscale;
-  -webkit-font-smoothing: antialiased;
-  text-rendering: optimizeLegibility;
-  font-family:Microsoft YaHei Regular, Microsoft YaHei Regular-Regular;
-  // font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
+    height: 100%;
+    -moz-osx-font-smoothing: grayscale;
+    -webkit-font-smoothing: antialiased;
+    text-rendering: optimizeLegibility;
+    font-family: Microsoft YaHei Regular, Microsoft YaHei Regular-Regular;
+    // font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
 }
 
 label {
-  font-weight: 700;
+    font-weight: 700;
 }
 
 html {
-  height: 100%;
-  box-sizing: border-box;
+    height: 100%;
+    box-sizing: border-box;
 }
 
 #app {
-  height: 100%;
+    height: 100%;
 }
 
 *,
 *:before,
 *:after {
-  box-sizing: inherit;
+    box-sizing: inherit;
 }
 
 .no-padding {
-  padding: 0px !important;
+    padding: 0px !important;
 }
 
 .padding-content {
-  padding: 4px 0;
+    padding: 4px 0;
 }
 
 a:focus,
 a:active {
-  outline: none;
+    outline: none;
 }
 
 a,
 a:focus,
 a:hover {
-  cursor: pointer;
-  color: inherit;
-  text-decoration: none;
+    cursor: pointer;
+    color: inherit;
+    text-decoration: none;
 }
 
 div:focus {
-  outline: none;
+    outline: none;
 }
 
 .fr {
-  float: right;
+    float: right;
 }
 
 .fl {
-  float: left;
+    float: left;
 }
 
 .pr-5 {
-  padding-right: 5px;
+    padding-right: 5px;
 }
 
 .pl-5 {
-  padding-left: 5px;
+    padding-left: 5px;
 }
 
 .block {
-  display: block;
+    display: block;
 }
 
 .pointer {
-  cursor: pointer;
+    cursor: pointer;
 }
 
 .inlineBlock {
-  display: block;
+    display: block;
 }
 
 .clearfix {
-  &:after {
-    visibility: hidden;
-    display: block;
-    font-size: 0;
-    content: " ";
-    clear: both;
-    height: 0;
-  }
+    &:after {
+        visibility: hidden;
+        display: block;
+        font-size: 0;
+        content: " ";
+        clear: both;
+        height: 0;
+    }
 }
 
 aside {
-  background: #eef1f6;
-  padding: 8px 24px;
-  margin-bottom: 20px;
-  border-radius: 2px;
-  display: block;
-  line-height: 32px;
-  font-size: 16px;
-  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-  color: #2c3e50;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-
-  a {
-    color: #337ab7;
-    cursor: pointer;
-
-    &:hover {
-      color: rgb(32, 160, 255);
+    background: #eef1f6;
+    padding: 8px 24px;
+    margin-bottom: 20px;
+    border-radius: 2px;
+    display: block;
+    line-height: 32px;
+    font-size: 16px;
+    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
+    color: #2c3e50;
+    -webkit-font-smoothing: antialiased;
+    -moz-osx-font-smoothing: grayscale;
+    a {
+        color: #337ab7;
+        cursor: pointer;
+        &:hover {
+            color: rgb(32, 160, 255);
+        }
     }
-  }
 }
 
 //main-container全局样式
 .app-container {
-  padding: 20px;
+    padding: 20px;
 }
 
 .components-container {
-  margin: 30px 50px;
-  position: relative;
+    margin: 30px 50px;
+    position: relative;
 }
 
 .pagination-container {
-  margin-top: 30px;
+    margin-top: 30px;
 }
 
 .text-center {
-  text-align: center
+    text-align: center
 }
 
 .sub-navbar {
-  height: 50px;
-  line-height: 50px;
-  position: relative;
-  width: 100%;
-  text-align: right;
-  padding-right: 20px;
-  transition: 600ms ease position;
-  background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%);
-
-  .subtitle {
-    font-size: 20px;
-    color: #fff;
-  }
-
-  &.draft {
-    background: #d0d0d0;
-  }
-
-  &.deleted {
-    background: #d0d0d0;
-  }
+    height: 50px;
+    line-height: 50px;
+    position: relative;
+    width: 100%;
+    text-align: right;
+    padding-right: 20px;
+    transition: 600ms ease position;
+    background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%);
+    .subtitle {
+        font-size: 20px;
+        color: #fff;
+    }
+    &.draft {
+        background: #d0d0d0;
+    }
+    &.deleted {
+        background: #d0d0d0;
+    }
 }
 
 .link-type,
 .link-type:focus {
-  color: #337ab7;
-  cursor: pointer;
-
-  &:hover {
-    color: rgb(32, 160, 255);
-  }
+    color: #337ab7;
+    cursor: pointer;
+    &:hover {
+        color: rgb(32, 160, 255);
+    }
 }
 
 .filter-container {
-  padding-bottom: 10px;
-
-  .filter-item {
-    display: inline-block;
-    vertical-align: middle;
-    margin-bottom: 10px;
-  }
+    padding-bottom: 10px;
+    .filter-item {
+        display: inline-block;
+        vertical-align: middle;
+        margin-bottom: 10px;
+    }
 }
 
 //refine vue-multiselect plugin
 .multiselect {
-  line-height: 16px;
+    line-height: 16px;
 }
 
 .multiselect--active {
-  z-index: 1000 !important;
+    z-index: 1000 !important;
+}
+
+.success {
+    color: #67C23A
+}
+
+.warning {
+    color: #E6A23C
+}
+
+.danger {
+    color: #F56C6C
 }
+
+.info {
+    color: #909399
+}

+ 2 - 2
src/utils/validate2.js

@@ -14,7 +14,7 @@ export function validateIP(rule, value, callback) {
 
 /* 是否手机号码或者固话*/
 export function validatePhoneTwo(rule, value, callback) {
-    const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/;;
+    const reg = /^((0\d{2,3}-\d{7,8})|(1[23456789]\d{9}))$/;;
     if (value == '' || value == undefined || value == null) {
         callback();
     } else {
@@ -40,7 +40,7 @@ export function validateTelphone(rule, value, callback) {
 }
 /* 是否手机号码*/
 export function validatePhone(rule, value, callback) {
-    const reg = /^[1][3,4,5,7,8][0-9]{9}$/;
+    const reg = /^[1][2,3,4,5,6,7,8,9][0-9]{9}$/;
     if (value == '' || value == undefined || value == null) {
         callback();
     } else {

+ 24 - 24
src/views/recharge/cash/index.vue

@@ -158,32 +158,32 @@ export default {
 
     /** 提交按钮 */
     submitForm(row) {
-      this.form.payType = 1
-      if(this.form.money == 0){
-        this.msgError("充值金额不能为0元")
-      }else{
-        this.$refs["form"].validate(valid => {
-          if (valid) {
+      // this.form.payType = 1
+      // if(this.form.money == 0){
+      //   this.msgError("充值金额不能为0元")
+      // }else{
+      //   this.$refs["form"].validate(valid => {
+      //     if (valid) {
 
-            this.loading = true
+      //       this.loading = true
 
-            this.formSubmit.userPhone = this.form.userPhone
-            this.formSubmit.userName = this.form.userName
-            this.formSubmit.money = Number(this.form.money).toFixed(2)
-            this.formSubmit.payType = this.form.payType
-            this.formSubmit.userId = this.form.userId
-            this.formSubmit.userId = this.form.userId
-            if (this.form.payType === 1) { //后台现金
-              order(this.formSubmit).then(response => {
-                this.msgSuccess("已生成支付订单");
-                this.codeUrl = '';
-                this.loading = false
-              });
-            }
-            this.reset()
-          }
-        })
-      }
+      //       this.formSubmit.userPhone = this.form.userPhone
+      //       this.formSubmit.userName = this.form.userName
+      //       this.formSubmit.money = Number(this.form.money).toFixed(2)
+      //       this.formSubmit.payType = this.form.payType
+      //       this.formSubmit.userId = this.form.userId
+      //       this.formSubmit.userId = this.form.userId
+      //       if (this.form.payType === 1) { //后台现金
+      //         order(this.formSubmit).then(response => {
+      //           this.msgSuccess("已生成支付订单");
+      //           this.codeUrl = '';
+      //           this.loading = false
+      //         });
+      //       }
+      //       this.reset()
+      //     }
+      //   })
+      // }
     },
     // 表单重置
     reset() {

+ 61 - 109
src/views/recharge/fileManagement/index.vue

@@ -11,7 +11,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="时间" label-width="40px">
+      <el-form-item label="上传时间" label-width="80px">
          <el-date-picker
           style="margin-top:5px;"
           v-model="dateRange"
@@ -25,46 +25,58 @@
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['system:admin:add']"
-        >下载充值模板</el-button>
+        <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <el-upload
-                class="upload-demo"
-                action="#"
-                :limit = 1
-                :on-change="handleChange"
-                :file-list="fileList"
-                :auto-upload="false"
-                accept=".xlsx,.xls"
-                style="display:inline-block;margin-left:10px;vertical-align: top;"
-                >
-                <el-button size="mini" type="primary">上传充值文件</el-button>
-              </el-upload>
+          ref="upload"
+          class="upload-demo"
+          action="#"
+          :limit = 1
+          :on-change="handleChange"
+          :auto-upload="false"
+          accept=".xlsx,.xls"
+          style="display:inline-block;margin-left:10px;vertical-align: top;"
+          >
+          <el-button size="mini" type="primary">上传文件</el-button>
+        </el-upload>
       </el-form-item>
     </el-form>
 
     <el-table v-loading="loading" :data="adminList" >
       <el-table-column label="id" align="center" prop="id"  show-overflow-tooltip />
-      <el-table-column label="类别" align="center" prop="businessType"  show-overflow-tooltip />
+      <el-table-column label="文件类别" align="center" prop="businessType"  show-overflow-tooltip />
       <el-table-column label="文件名称" align="center" prop="oriName"  show-overflow-tooltip />
+      <el-table-column label="文件大小" align="center" prop="fileSize"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          {{scope.row.fileSize / 1024}}Kb
+        </template>
+      </el-table-column>
       <el-table-column label="上传时间" align="center" prop="createTime"  show-overflow-tooltip />
+      <el-table-column label="文件失效时间" align="center" prop="expriceAt"  show-overflow-tooltip />
+      <el-table-column label="文件是否生效" align="center" prop="activeFlag"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span :class="scope.row.activeFlag == '1' ? 'success' :  'danger'">{{scope.row.activeFlag == '1' ? '未生效' :  '生效'}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="文件状态" align="center" prop="delFlag"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span :class="scope.row.delFlag == '1' ? 'success' :  'danger'">{{scope.row.delFlag == '1' ? '未删除' :  '删除'}}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  show-overflow-tooltip >
         <template slot-scope="scope">
-          <el-button v-if ="scope.row.url"
+          <el-button v-if ="scope.row.url && scope.row.delFlag == '1'"
+            size="mini"
+            type="text"
+            icon="el-icon-bottom"
+            @click="handleExport(scope.row)"
+          >下载</el-button>
+          <el-button v-if ="scope.row.url && scope.row.delFlag == '0'"
             size="mini"
             type="text"
             icon="el-icon-bottom"
+            disabled
             @click="handleExport(scope.row)"
           >下载</el-button>
-          <!-- <span v-if="scope.row.url">
-            <span v-if="scope.row.url == '' || scope.row.url == null">文件整理中...请稍后查看</span>
-            <span else>{{scope.row.url}}</span>
-          </span> -->
 
         </template>
       </el-table-column>
@@ -81,7 +93,7 @@
 </template>
 
 <script>
-import { addChannel, updataChannel, delChannel, listChannel, fileId, uploadFileApi, fileTakeEffect, getFile, listRecharge } from "@/api/system/product";
+import { addChannel, updataChannel, delChannel,  fileId, uploadFileApi, fileTakeEffect, getFile, listRecharge } from "@/api/system/product";
 export default {
   name: "admin",
   data() {
@@ -118,19 +130,9 @@ export default {
         current: 1,
         size: 10,
         name: undefined,
-        aliasName: undefined,
-      },
-      // 表单参数
-      form: {
-        id:'',
-        name:'',
-        introduce:'',
-        logo:"",
-        batchNo:undefined,
-        businessType:"产品logo",
-        uploadType:"file",
       },
 
+
       //  上传图片
       dialogImageUrl: '',
       dialogVisible: false,
@@ -162,9 +164,13 @@ export default {
     /** 查询参数列表 */
     getList() {
       this.loading = true;
-      let data = this.addDateRange(this.queryParams,this.dateRange)
-      data.params = undefined
-      listRecharge(data).then(response => {
+      console.log(this.dateRange)
+      if(this.dateRange.length>0){
+        this.queryParams.startTime = this.dateRange[0]
+        this.queryParams.endTime = this.dateRange[1]
+      }
+      console.log(this.queryParams)
+      listRecharge(this.queryParams).then(response => {
         if(response.data.records.length>0){
           let arrBig = response.data.records
           let arrr = []
@@ -173,27 +179,11 @@ export default {
               arrr.push(arrBig[i])
             }
           }
-          // let arr = []
-          // arr = response.data.records.map(item =>{
-          //   return {
-          //     batchNos:[item.logo]
-          //   }
-          // })
-          // for(let i=1;i<response.data.records.length; i++){
-          //   arr[0].batchNos.push(response.data.records[i].logo)
-          // }
-          // getFile(arr[0]).then(response =>{
-          //   const reverse = response.data.reverse()
-          //   for(let i=0;i<response.data.length;i++){
-          //     arrBig[i].logo = reverse[i].url
-          //   }
-          // })
-          setTimeout(()=>{
+          // setTimeout(()=>{
             this.loading = false;
             this.adminList = arrr;
             this.total = response.data.total;
-            console.log(this.adminList)
-          },1000)
+          // },1000)
 
         }else{
           this.adminList = []
@@ -227,31 +217,12 @@ export default {
     resetQuery() {
       this.dateRange = [];
       this.resetForm("queryForm");
+      this.queryParams.startTime = undefined
+      this.queryParams.endTime = undefined
+      this.queryParams.name = undefined
       this.handleQuery();
     },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.form.id =undefined
-      this.form.name =undefined
-      this.form.introduce =undefined
-      this.form.logo =undefined
-      this.reset();
-      this.open = true;
-      this.title = "添加参数";
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!=1
-      this.multiple = !selection.length
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      Object.assign(this.form, row.id ? this.adminList.find(val=>val.id === row.id) : this.adminList.find(val=>val.id === this.ids[0]))
-      this.open = true;
-      this.title = "修改参数";
-    },
+
 
     handleChange(param){
       this.limit = 1
@@ -264,39 +235,20 @@ export default {
           this.form.batchNo = res.data
           this.formData = new FormData()// FormData 对象
           this.formData.append('files', param.raw)
-
           this.form.businessType = "充值表格"
           uploadFileApi(this.form.batchNo,this.form.businessType,this.formData).then(response => {
-            // getFile({batchNo:this.form.batchNo}).then(response => {
-
-            // })
             if(response.data.length>0){
               let ids = new FormData()
               ids.append('ids[]', response.data[0].id)
-              // 上传图片生效
+              // 上传生效
               fileTakeEffect(response.data[0].batchNo,ids).then(response => {
-                this.msgSuccess("上传成功");
-                // if (this.form.id != undefined) {
-                //   updataChannel(this.form).then(response => {
-                //     this.loading = false,
-                //     this.msgSuccess("修改成功");
-                //     this.open = false;
-                //     this.getList();
-                //   }).catch(()=>{
-                //     this.loading = false,
-                //     this.open = false
-                //   })
-                // } else {
-                //   addChannel(this.form).then(response => {
-                //     this.loading = false,
-                //     this.msgSuccess("新增成功");
-                //     this.open = false;
-                //     this.getList();
-                //   }).catch(()=>{
-                //     this.loading = false,
-                //     this.open = false
-                //   })
-                // }
+                if(res.status == "SUCCESS"){
+                  this.msgSuccess("上传成功");
+                  this.$refs.upload.submit();
+                  this.getList()
+                }else{
+                  this.$message.error(res.msg)
+                }
               }).catch(err =>{
               })
             }

+ 43 - 1
src/views/recharge/personnel/index.vue

@@ -31,6 +31,21 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <!-- <el-upload
+          ref="upload"
+          class="upload-demo"
+          action="#"
+          :limit = 1
+          :on-change="handleChange"
+          :auto-upload="false"
+          accept=".xlsx,.xls"
+          style="display:inline-block;margin-left:10px;vertical-align: top;"
+          >
+          <el-button size="mini" type="primary">上传充值文件</el-button>
+        </el-upload> -->
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -97,6 +112,7 @@
 
 <script>
 import {  listChannel, personJob, staff } from "@/api/recharge/personnel";
+import { uploadFile } from "@/api/system/product";
 import { allRadio } from "@/api/recharge/radio";
 export default {
   name: "admin",
@@ -158,7 +174,11 @@ export default {
         id:[
            { required: true, message: "充值比例不能为空", trigger: "change"},
         ],
-      }
+      },
+      limit:100,
+      num:0,
+       // 文件显示
+      fileList:[{"url":''}],
     };
   },
   created() {
@@ -166,6 +186,28 @@ export default {
     this.getListczgl();
   },
   methods: {
+    //上传文件
+    handleChange(param){
+      console.log(param)
+      this.limit = 1
+      this.num++
+      if(this.num>1){
+        this.num = 0
+        return false
+      }else{
+        let  data = new FormData()// FormData 对象
+        data.append('file', param.raw)
+        uploadFile(data).then(res=>{
+          if(res.status == "SUCCESS"){
+            this.msgSuccess('充值文件上传成功')
+            this.$refs.upload.submit();
+          }else{
+            this.$message.error(res.msg)
+          }
+
+        })
+      }
+    },
     forceUpdate(){ //重置form
       this.form = JSON.parse(JSON.stringify(this.form));
     },

+ 0 - 3
src/views/system/product/index.vue

@@ -193,9 +193,6 @@ export default {
   methods: {
     handleRemove(file) {
       this.form.logo = undefined
-      // this.$nextTick(() => {
-      //       this.$refs['form'].clearValidate(['logo']);
-      //   })
       this.limit = 100
       document.getElementsByClassName("el-upload-list el-upload-list--picture-card")[0].firstChild.remove()
       document.getElementsByClassName("el-upload--picture-card")[0].style.display="block"

+ 5 - 5
src/views/system/user/index.vue

@@ -97,7 +97,7 @@
           </el-form-item>
         </el-form>
 
-        <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" height="calc(100vh - 12vh - 120px)"> 
+        <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" height="calc(100vh - 12vh - 120px)">
           <el-table-column type="selection" width="50" align="center" />
           <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible"  show-overflow-tooltip />
           <el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible"  show-overflow-tooltip  />
@@ -425,7 +425,7 @@ export default {
         phonenumber: [
           { required: true, message: "手机号码不能为空", trigger: "blur" },
           {
-            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            pattern: /^1[2|3|4|5|6|7|8|9][0-9]\d{8}$/,
             message: "请输入正确的手机号码",
             trigger: "blur"
           }
@@ -588,16 +588,16 @@ export default {
       getUser(userId).then(response => {
         this.form = response.data.data;
         this.postOptions = response.data.posts
-        
+
         this.roleOptions = response.data.roles;
-       
+
 
         this.form.postId = response.data.postIds[0]
         this.form.roleId = response.data.roleIds[0]
           this.open = true;
           this.title = "修改用户";
           this.form.password = "";
-        
+
       });
     },
     /** 重置密码按钮操作 */

+ 2 - 2
vue.config.js

@@ -33,8 +33,8 @@ module.exports = {
         proxy: {
             // detail: https://cli.vuejs.org/config/#devserver-proxy
             [process.env.VUE_APP_BASE_API]: {
-                target: `http://172.16.120.213:8085`, //本地
-                //target: 'https://smartpark.caih.com/dxapi/', //东信
+                //target: `http://172.16.120.213:8085`, //本地
+                target: 'https://smartpark.caih.com/dxapi/', //东信
                 changeOrigin: true,
                 pathRewrite: {
                     ['^' + process.env.VUE_APP_BASE_API]: ''