gang.huang před 2 roky
rodič
revize
6b491275a6
3 změnil soubory, kde provedl 59 přidání a 4 odebrání
  1. 16 2
      src/api/index.js
  2. 42 1
      src/pages/subPages/reconciliation.vue
  3. 1 1
      vue.config.js

+ 16 - 2
src/api/index.js

@@ -107,8 +107,8 @@ let requestLoading = (url, method, params) => {
 // const Prefix = 'http://dd.guozipay.com/mchsrv/index.php?';
 
 // const Prefix = 'http://192.168.1.218/mchsrv/index.php?';
-const Prefix = 'https://admin.xyzshops.cn/mchsrv/index.php?';
-// const Prefix = 'https://test.xyzshops.cn/mchsrv/index.php?';
+// const Prefix = 'https://admin.xyzshops.cn/mchsrv/index.php?';
+const Prefix = 'https://test.xyzshops.cn/mchsrv/index.php?';
 
 // 椰子临时线上地址
 // const Prefix = 'http://121.89.196.45/mobile/index.php?';
@@ -436,6 +436,20 @@ export const getRec = (params) => {
         timeout: 120000,
     })
 }
+// 对账管理导出订单
+export const getExportOrder = (params) => {
+    return axios({
+        method: 'post',
+        url: `${Prefix}act=merchant_order&op=create_task&client_type=ajax`,
+        withCredentials: true,
+        headers: {
+            "Content-Type": "application/x-www-form-urlencoded"
+          },
+        data: params,
+        timeout: 120000,
+    })
+}
+
 // 设置话费充值
 export const phonrRec = (params) => {
     return axios({

+ 42 - 1
src/pages/subPages/reconciliation.vue

@@ -22,6 +22,8 @@
             :disabled="isDisabled"></el-date-picker>
           <el-button style="margin-left:10px;" type="primary" @click="onSearch" :loading="searchLoading">查询</el-button>
           <el-button style="margin-left:10px;" type="danger" @click="onReset">重置</el-button>
+          <el-button style="margin-left:10px;" type="primary" @click="onExportOrder">导出订单</el-button>
+
       </div>
       <el-table :data="tableData" border style="width: 100%;font-size:13px;" v-loading="isLoading">
         <el-table-column align="center" prop="count" label="订单总数" />
@@ -37,7 +39,7 @@
 
 <script>
 // getRec-对账管理
-import { getRec } from '@/api'
+import { getRec,getExportOrder } from '@/api'
 import { RecTime } from '@/utils/constants'
 export default {
   name: 'reconciliation',
@@ -92,6 +94,45 @@ export default {
     }
   },
   methods: {
+  async onExportOrder(){
+       try {
+        if (!this.value) {
+          if (this.timer) {
+            window.clearTimeout(this.timer)
+          }
+          this.timer = setTimeout(() => {
+            this.$message.warning('请选择日期类型')
+          }, 1000)
+          return
+        }
+        this.searchLoading = true
+        this.isLoading = true
+        this.startTime = this.dataRange[0]/1000
+        this.endTime = this.dataRange[1]/1000
+        let param = new URLSearchParams()
+        param.append('time_type', this.value)
+        param.append('start_time', this.startTime)
+        param.append('end_time', this.endTime)
+        let res = await getExportOrder(param)
+        console.log('导出订单', res);
+        if (res && res.code == 200) {
+          this.recForm = res.datas
+          if (!this.tableData.length) {
+            this.tableData.push(res.datas)
+          } else {
+            const obj = this.tableData[0]
+            // console.log('obj', obj);
+            this.tableData[0] = Object.assign(obj, res.datas)
+          }
+        }
+        this.isLoading =  false
+        this.searchLoading = false
+      } catch (error) {
+        console.log(error);
+        this.isLoading =  false
+        this.searchLoading = false
+      }
+    },
     // 查询
     async onSearch() {
       try {

+ 1 - 1
vue.config.js

@@ -33,7 +33,7 @@ module.exports = {
     devServer: {
         open: true,
         // host: 'localhost',
-        host: '192.168.1.218',
+        host: '192.168.1.6',
         port: 3333,
         https: false,
         //以上的ip和端口是我们本机的;下面为需要跨域的