Browse Source

no message

GeekFish 4 years ago
parent
commit
c88524eb5c

+ 37 - 0
src/api/customerManage/customer.js

@@ -0,0 +1,37 @@
+import request from '@/utils/request'
+
+// 查询列表
+export function listCustomer(data) {
+  return request({
+    url: '/system/web/customer/searchByPage',
+    method: 'post',
+    data: data
+  })
+}
+
+//用户状态
+export function userStatus(data) {
+  return request({
+    url: '/system/web/customer/update',
+    method: 'post',
+    data: data
+  })
+}
+
+//账号删除
+export function delUser(data) {
+  return request({
+    url: '/system/web/customer/update',
+    method: 'post',
+    data: data
+  })
+}
+
+//密码重置
+export function resetPassword(data) {
+  return request({
+    url: '/system/web/customer/resetPassword',
+    method: 'post',
+    data: data
+  })
+}

+ 19 - 0
src/api/order/baseOrder.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 查询列表
+export function listOrder(query) {
+  return request({
+    url: '/system/web/order/searchByPage',
+    method: 'post',
+    data: query
+  })
+}
+
+// 查询订单详情
+export function orderDetail(query) {
+  return request({
+    url: '/system/web/orderDetail/searchByOrderGuid',
+    method: 'get',
+    params: query
+  })
+}

+ 0 - 1
src/api/order/inlineOrder.js

@@ -42,4 +42,3 @@ export function createOrder(data) {
   })
 }
 
-

+ 28 - 1
src/api/order/subscription.js

@@ -33,7 +33,7 @@ export function areaTree(data) {
   })
 }
 
-//查询区域树
+//查询订单
 export function createOrder(data) {
   return request({
     url: '/system/web/order/create-order',
@@ -42,4 +42,31 @@ export function createOrder(data) {
   })
 }
 
+// 查询购买对象列表
+export function listCustomer(query) {
+  return request({
+    url: '/system/web/customer/coustomer-list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 确认付款
+export function pay(data) {
+  return request({
+    url: '/system/web/order/collect-money',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询购买对象列表
+export function orderDetail(query) {
+  return request({
+    url: '/system/web/order/offline-order-detail',
+    method: 'get',
+    params: query
+  })
+}
+
 

+ 28 - 0
src/router/index.js

@@ -64,6 +64,34 @@ export const constantRoutes = [
         meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
       }
     ]
+  },
+  {
+    path: '/order',
+    component: Layout,
+    hidden: true,
+    redirect: 'noredirect',
+    children: [
+      {
+        path: 'orderDetail',
+        component: (resolve) => require(['@/views/order/inlineOrder/orderDetail'], resolve),
+        name: 'orderDetail',
+        meta: { title: '订单详情', icon: 'user' }
+      }
+    ]
+  },
+  {
+    path: '/order',
+    component: Layout,
+    hidden: true,
+    redirect: 'noredirect',
+    children: [
+      {
+        path: 'baseOrderDetail',
+        component: (resolve) => require(['@/views/order/baseOrder/orderDetail'], resolve),
+        name: 'orderDetail',
+        meta: { title: '订单详情', icon: 'user' }
+      }
+    ]
   },
   {
     path: '/user',

+ 224 - 0
src/views/customerManage/customer/index.vue

@@ -0,0 +1,224 @@
+<template>
+  <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form-item prop="phonenumber">
+          <el-input
+            v-model="queryParams.condition"
+            placeholder="请输入类别名称"
+            clearable
+            size="small"
+            style="width: 240px"
+            @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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table v-loading="loading" :data="list">
+        <el-table-column label="序号" type="index" width="50" align="center" />
+        <el-table-column label="客户账号" align="center" prop="account" />
+        <el-table-column label="客户类型" align="center" prop="customerType" />
+        <el-table-column label="微信号/昵称" align="center" prop="nickName" />
+        <el-table-column label="客户名称" align="center" prop="customerName" />
+        <el-table-column label="绑定手机号" align="center" prop="phone" />
+        <el-table-column label="认证状态" align="center" width="160">
+          <template slot-scope="scope">
+            <span>{{ scope.row.isCompany == 0 ? '是' : '否' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="创建时间" align="center" prop="modifiedTime" width="160">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.modifiedTime) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="客户状态" align="center" prop="createTime">
+          <template slot-scope="scope">
+              <el-switch
+                v-model="scope.row.isEnable"
+                style="display: block"
+                @change="handelUserStatus($event,scope.row)"
+                :active-value="1"
+                :inactive-value="0"
+                active-text="未启用"
+                inactive-text="已启用">
+              </el-switch>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          label="操作"
+          align="center"
+          width="280"
+          class-name="small-padding fixed-width"
+        >
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="success"
+              icon="el-icon-view"
+              @click="resetPw(scope.row)"
+            >重置密码</el-button>
+            <el-button
+              size="mini"
+              type="primary"
+              icon="el-icon-view"
+              @click="handleView(scope.row)"
+            >查看</el-button>
+            <el-button
+              size="mini"
+              type="danger"
+              @click="handleDelete(scope.row)"
+              icon="el-icon-delete"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNo"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+      <add-mobiel
+      			v-if="modal.visibleModal"
+      			:title="modal.title"
+      			:action="modal.action"
+      			:visible="modal.visibleModal"
+      			:selectRow="modal.selectRow"
+      			@closeModal="closeModal">
+      		</add-mobiel>
+  </div>
+</template>
+<script>
+import { listCustomer , userStatus , delUser , resetPassword } from "@/api/customerManage/customer";
+import addMobiel from './modal/addMobiel'
+export default {
+  name: "customer",
+  components: {
+    addMobiel
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 表格数据
+      list: null,
+      // 状态数据字典
+      statusOptions: [],
+      // 表单参数
+      form: {},
+      //弹出层
+      modal:{
+        action:'',
+        title:'',
+        visibleModal:false,
+        selectRow:null
+      },
+      // 查询参数
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询产婆类别列表 */
+    getList() {
+      this.loading = true;
+      listCustomer(this.queryParams).then(res => {
+          if(res.retHead.errCode == 0){
+            this.list = res.retBody
+            this.total = res.retHead.total;
+          }
+          this.loading = false;
+        }
+      );
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 查看按钮操作 */
+    handleView(item){
+        this.modal.visibleModal = true
+        this.modal.title = '用户详情'
+        this.modal.action = 'view'
+        this.modal.selectRow = item
+    },
+    /** 删除按钮操作 */
+    handleDelete(item) {
+      let params = {
+        guid:item.guid,
+        state:1
+      }
+      this.$confirm('是否确认删除该数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delUser(params);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    //密码重置
+    resetPw(item){
+      let params = {
+        guid:item.guid,
+      }
+      this.$confirm('是否确认要重置该用户登录密码?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return resetPassword(params);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    //更改用户状态
+    handelUserStatus(val,row){
+      let params = {
+        guid:row.guid,
+        isEnable:val
+      }
+      let _this = this;
+      this.$confirm('你确定是否改变改客户的账号状态?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+            return userStatus(params);
+        }).then(() => {
+            _this.getList();
+            _this.msgSuccess("操作成功");
+        }).catch(function() {
+            _this.getList()
+        });
+    },
+    //窗口关闭
+    closeModal(flag = false){
+      this.modal.visibleModal = false
+      flag && this.getList()
+    }
+  }
+};
+</script>

+ 136 - 0
src/views/customerManage/customer/modal/addMobiel.vue

@@ -0,0 +1,136 @@
+<template>
+  <el-dialog
+    :title="modalTitle"
+    :visible.sync="modalVisible"
+    :width="formLabelWidth"
+    top="2vh"
+    @close="handleCancel">
+    <div class="mobile">
+        <el-form label-width="90px" :model="form" ref="from" class="from">
+                <el-form-item label="用户账号:" prop="typeName">
+                    <el-input type="text" v-model="form.account" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+                <el-form-item label="用户类型:">
+                    <el-input type="text" v-model="form.customerType" :disabled="true" placeholder="类别值后台自动生成"></el-input>
+                </el-form-item>
+                <el-form-item label="用户昵称:">
+                    <el-input type="text" v-model="form.nickName" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+                <el-form-item label="用户姓名:">
+                    <el-input type="text" v-model="form.customerName" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+                <el-form-item label="性别:">
+                    {{form.sex}}
+                    <el-radio-group v-model="form.sex">
+                       <el-radio :label="item.dictValue" :disabled="limit.isRead" v-for="(item,index) in sexOptions">{{item.dictLabel}}</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+                <el-form-item label="绑定手机:">
+                    <el-input type="text" v-model="form.phone" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+                <el-form-item label="绑定微信:">
+                    <el-input type="text" v-model="form.methodology" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+                <el-form-item label="企业认证:">
+                    <el-input type="text" v-model="form.methodology" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+                <el-form-item label="个人认证:">
+                    <el-input type="text" v-model="form.methodology" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+                <el-form-item label="注册时间:">
+                    <el-input type="text" v-model="form.methodology" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+                <el-form-item label="用户状态:">
+                    <el-input type="text" v-model="form.methodology" :disabled="limit.isRead"></el-input>
+                </el-form-item>
+            </el-form>
+    </div>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="handleCancel">取 消</el-button>
+      <el-button type="primary" @click="submit" v-if="!limit.isRead">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  name: 'addMobiel',
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: 'title'
+    },
+    action: {
+      type: String,
+      default: 'add'
+    },
+    selectRow: {
+      type: Object,
+      default:null
+    }
+  },
+  watch: {
+    visible(newVal, oldVal) {
+      this.modalVisible = newVal;
+    },
+    title(newVal, oldVal) {
+      this.modalTitle = newVal;
+    },
+    action(newVal, oldVal) {
+      this.modalAction = newVal;
+    },
+    selectRow(newVal, oldVal) {
+      this.modalSelectRow = newVal;
+    }
+  },
+  data() {
+    return {
+      modalTitle: this.title,
+      modalVisible: this.visible,
+      modalAction: this.action,
+      modalSelectRow: this.selectRow,
+      formLabelWidth: '1024px',
+      //字典
+      sexOptions:[],
+      //窗口权限
+      limit: {
+        isRead: false, //是否只读
+        isAdd: false //是否可写
+      },
+      //表单
+      form: {
+        productTypeExpansions:[]
+      }
+    };
+  },
+  created() {
+    // console.log(this.selectRow)
+    this.getDicts("system_sex").then(response => {
+      this.sexOptions = response.data;
+    });
+    console.log(this.modalSelectRow)
+    switch (this.modalAction) {
+      case 'view':
+        this.limit.isRead = true;
+        this.form = Object.assign({},this.modalSelectRow)
+        break;
+      default:
+        break;
+    }
+  },
+  methods: {
+    //窗口关闭
+    handleCancel() {
+      this.$emit('closeModal', false);
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 202 - 0
src/views/order/baseOrder/index.vue

@@ -0,0 +1,202 @@
+<template>
+  <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form-item>
+          <el-date-picker
+            v-model="dateRange"
+            size="small"
+            style="width: 240px"
+            value-format="yyyy-MM-dd"
+            type="daterange"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          ></el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            v-model="queryParams.orderStatus"
+            placeholder="订单状态"
+            clearable
+            size="small"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="dict in statusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            v-model="queryParams.payChannel"
+            placeholder="支付方式"
+            clearable
+            size="small"
+            style="width: 240px"
+          >
+            <el-option
+              v-for="dict in payStatusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-input
+            v-model="queryParams.account"
+            placeholder="客户账号"
+            clearable
+            size="small"
+            style="width: 240px"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-input
+            v-model="queryParams.orderNo"
+            placeholder="请输入订单编号"
+            clearable
+            size="small"
+            style="width: 240px"
+            @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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table v-loading="loading" :data="list">
+        <el-table-column label="序号" type="index" width="50" align="center" />
+        <el-table-column label="下单时间" align="center" prop="createTime">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.createTime) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="订单编号" align="center" prop="orderNo" />
+        <el-table-column label="客户账号" align="center" prop="account"/>
+        <el-table-column label="客户名称" align="center" prop="customerName"/>
+        <el-table-column label="支付方式" align="center" prop="payChannel"/>
+        <el-table-column label="实付金额(¥)" align="center" prop="payAmount"/>
+        <el-table-column label="购买碳汇量(kg)" align="center" prop="orderCarbonAmount"/>
+        <el-table-column label="订单状态" align="center" prop="orderStatus"></el-table-column>
+        <el-table-column
+          label="操作"
+          align="center"
+          width="190"
+          class-name="small-padding fixed-width"
+        >
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="warning"
+              v-if="scope.row.statusNum == 2"
+              @click="handleCertificate(scope.row)"
+            >证书查看</el-button>
+            <el-button
+              size="mini"
+              type="success"
+              @click="handleView(scope.row)"
+            >查看详情</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNo"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+  </div>
+</template>
+<script>
+import { listOrder } from "@/api/order/baseOrder";
+export default {
+  name: "baseOrder",
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 表格数据
+      list: null,
+      // 状态数据字典
+      statusOptions: [],
+      payStatusOptions:[],
+      // 日期范围
+      dateRange: [],
+      // 表单参数
+      form: {},
+      // 查询参数
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10
+      }
+    };
+  },
+  created() {
+    //申请状态字典
+    this.getDicts("order_base_status").then(response => {
+      this.statusOptions = response.data;
+    });
+    //支付方式
+    this.getDicts("order_base_playpaytype").then(response => {
+      this.payStatusOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    /** 查询列表 */
+    getList() {
+      this.loading = true;
+      listOrder(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
+          if(res.retHead.errCode == 0){
+            this.list = res.retBody
+            this.total = res.retHead.total;
+          }
+          this.loading = false;
+        }
+      );
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams = {
+        pageNo: 1,
+        pageSize: 10
+      }
+      this.handleQuery();
+    },
+    /**订单查看**/
+    handleView(item){
+      this.$router.push({path:"/order/baseOrderDetail/",query:{id:item.guid}})
+    },
+    /**证书查看**/
+    handleCertificate(item){
+
+    },
+    //窗口关闭
+    closeCreateModal(flag = false){
+      this.modal.create.visibleModal = false
+      flag && this.getList()
+    },
+    closePlaypayModal(flag = false){
+      this.modal.playpay.visibleModal = false
+      flag && this.getList()
+    }
+  }
+};
+</script>

+ 180 - 0
src/views/order/baseOrder/orderDetail.vue

@@ -0,0 +1,180 @@
+<template>
+  <div class="orderDetail" v-loading="loading">
+    <div class="orderDetail-box">
+       <div class="orderDetail-box-header">
+          订单信息
+       </div>
+       <div class="orderDetail-box-content">
+          <el-row :gutter="20">
+            <el-col :span="8"><span class="label">订单编号:</span><span class="txt">{{datas.orderNo}}</span></el-col>
+            <el-col :span="8"><span class="label">订单状态:</span><span class="txt">{{datas.state == 0 ? '失效' : '有效'}}</span></el-col>
+            <el-col :span="8"><span class="label">下单时间:</span><span class="txt">{{datas.createTime || '-'}}</span></el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="8"><span class="label">支付方式:</span><span class="txt">{{datas.payChannel || '-'}}</span></el-col>
+            <el-col :span="8"><span class="label">支付流水号:</span><span class="txt">{{datas.payNo || '-'}}</span></el-col>
+            <el-col :span="8"></el-col>
+          </el-row>
+       </div>
+    </div>
+    <div class="orderDetail-box">
+       <div class="orderDetail-box-header">
+          客户信息
+       </div>
+       <div class="orderDetail-box-content">
+          <el-row :gutter="20">
+            <el-col :span="8"><span class="label">客户账号:</span><span class="txt">{{datas.account || '-'}}</span></el-col>
+            <el-col :span="8"><span class="label">联系电话:</span><span class="txt">{{datas.phone || '-'}}</span></el-col>
+            <el-col :span="8"><span class="label">客户名称:</span><span class="txt">{{datas.customerName || '-'}}</span></el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="8"><span class="label">客户类型:</span><span class="txt">{{datas.typeName || '-'}}</span></el-col>
+            <el-col :span="8"></el-col>
+            <el-col :span="8"></el-col>
+          </el-row>
+       </div>
+    </div>
+    <div class="orderDetail-box">
+       <div class="orderDetail-box-header">
+          订单商品
+       </div>
+       {{payStatusOptions}}
+       <div class="orderDetail-box-content">
+          <el-table :data="datas.goodsOrderDetailList" border>
+            <el-table-column label="序号" type="index" width="50" align="center" />
+            <el-table-column label="商品编号" align="center" prop="goodsCode" />
+            <el-table-column label="商品名称" align="center" prop="goodsName"/>
+            <el-table-column label="商品类型" align="center" prop="typeName"/>
+            <el-table-column label="有效期至" align="center" prop="goodsSaleDate"/>
+            <el-table-column label="单价" align="center" prop="goodsPrice"/>
+            <el-table-column label="碳汇量(kg)" align="center" prop="saleNum"/>
+            <el-table-column label="金额" align="center" prop="amount"></el-table-column>
+          </el-table>
+          <div class="tableTotal">
+              总计 <span class="num">{{saleNumTotal}}</span> <span class="price">{{priceTotal}}</span>
+          </div>
+       </div>
+    </div>
+    <div class="orderDetail-footer">
+       <el-button type="info" @click="goPage">返回</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { orderDetail } from "@/api/order/baseOrder";
+  export default{
+    name:"baseOrderDetail",
+    created() {
+      this.getDetail();
+      //支付方式
+      this.getDicts("order_base_playpaytype").then(response => {
+        this.payStatusOptions = response.data;
+        console.log(this.payStatusOptions)
+      });
+    },
+    data(){
+      return{
+        payStatusOptions:[],
+        datas:{
+          orderNo:'',
+          items:[],
+        },
+        loading:false,
+      }
+    },
+    methods:{
+      getDetail(){
+        this.loading = true
+        let params = {
+          orderGuid:this.$route.query.id
+        }
+        orderDetail(params).then(res => {
+            if (res.retHead.errCode === 0) {
+              this.loading = false
+              this.datas = res.retBody
+            }
+        });
+      },
+      goPage(){
+        this.$router.go(-1)
+      }
+    },
+    computed:{
+      //碳汇量计算
+      saleNumTotal(){
+        let totalSumAll = 0;
+        this.datas.goodsOrderDetailList.map((item) => {
+          if(!isNaN(item.saleNum)) totalSumAll += item.saleNum
+        })
+        if(isNaN(totalSumAll)){
+          return 0
+        }
+        return totalSumAll
+      },
+      //总价计算
+      priceTotal(){
+        let totalPrice = 0;
+        this.datas.goodsOrderDetailList.map((item) => {
+          if(!isNaN(item.goodsPrice)) totalPrice += item.goodsPrice
+        })
+        if(isNaN(totalPrice)){
+          return 0
+        }
+        return totalPrice
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .orderDetail{
+    margin:30px 40px;
+    &-box{
+      border-bottom:1px solid #EBEBEB;
+      &-header{
+        margin-top:10px;
+        height:50px;
+        line-height:50px;
+        font-size:16px;
+        font-weight:bold;
+      }
+      &-content{
+        padding-bottom:10px;
+        .el-col{
+          height:35px;
+          line-height:35px;
+          font-size:14px;
+          .label{
+            color:#272727;
+            font-weight:bold;
+            margin-right:10px;
+          }
+          .txt{
+            color:#5A5A5A;
+          }
+        }
+        .tableTotal{
+          position:relative;
+          height:40px;
+          line-height:50px;
+          .num,
+          .price{
+            position:absolute;
+            top:0;
+          }
+          .num{
+            right:320px;
+          }
+          .price{
+            right:90px;
+          }
+        }
+      }
+    }
+    &-footer{
+      text-align:center;
+      padding:15px 0;
+    }
+  }
+</style>

+ 71 - 37
src/views/order/inlineOrder/index.vue

@@ -3,7 +3,7 @@
       <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
         <el-form-item>
           <el-select
-            v-model="queryParams.applyStatus"
+            v-model="queryParams.orderStatus"
             placeholder="订单状态"
             clearable
             size="small"
@@ -19,7 +19,7 @@
         </el-form-item>
         <el-form-item>
           <el-input
-            v-model="queryParams.applyCustomName"
+            v-model="queryParams.account"
             placeholder="请输入企业账号"
             clearable
             size="small"
@@ -29,7 +29,7 @@
         </el-form-item>
         <el-form-item>
           <el-input
-            v-model="queryParams.applyCustomName"
+            v-model="queryParams.customerName"
             placeholder="请输入企业名称"
             clearable
             size="small"
@@ -39,7 +39,7 @@
         </el-form-item>
         <el-form-item>
           <el-input
-            v-model="queryParams.applyCustomName"
+            v-model="queryParams.orderNo"
             placeholder="请输入订单编号"
             clearable
             size="small"
@@ -79,20 +79,27 @@
         <el-table-column
           label="操作"
           align="center"
-          width="280"
+          width="320"
           class-name="small-padding fixed-width"
         >
           <template slot-scope="scope">
             <el-button
               size="mini"
               type="primary"
-              @click="handleCreate(scope.row)"
+              v-if="scope.row.status == 1"
+              @click="handlePay(scope.row)"
             >确认收款</el-button>
             <el-button
               size="mini"
-              type="danger"
-              @click="handleDelete(scope.row)"
-            >删除</el-button>
+              type="warning"
+              v-if="scope.row.status == 2"
+              @click="handleCertificate(scope.row)"
+            >证书查看</el-button>
+            <el-button
+              size="mini"
+              type="success"
+              @click="handleView(scope.row)"
+            >查看详情</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -104,21 +111,31 @@
         @pagination="getList"
       />
       <add-mobiel
-      			v-if="modal.visibleModal"
-      			:title="modal.title"
-      			:action="modal.action"
-      			:visible="modal.visibleModal"
-      			@closeModal="closeModal">
+      			v-if="modal.create.visibleModal"
+      			:title="modal.create.title"
+      			:action="modal.create.action"
+      			:visible="modal.create.visibleModal"
+      			@closeCreateModal="closeCreateModal">
       		</add-mobiel>
+      <pay-mobiel
+          v-if="modal.playpay.visibleModal"
+          :title="modal.playpay.title"
+          :action="modal.playpay.action"
+          :visible="modal.playpay.visibleModal"
+          :selectRow="modal.playpay.selectRow"
+          @closePlaypayModal="closePlaypayModal"
+      ></pay-mobiel>
   </div>
 </template>
 <script>
 import { listOrder , delApplyItem , areaTree} from "@/api/order/inlineOrder";
 import addMobiel from './modal/addMobiel'
+import payMobiel from './modal/payMobiel'
 export default {
   name: "inlineOrder",
   components: {
-    addMobiel
+    addMobiel,
+    payMobiel
   },
   data() {
     return {
@@ -136,9 +153,17 @@ export default {
       form: {},
       //弹出层
       modal:{
-        action:'',
-        title:'',
-        visibleModal:false,
+        create:{
+          action:'',
+          title:'',
+          visibleModal:false,
+        },
+        playpay:{
+          action:'',
+          title:'',
+          visibleModal:false,
+          selectRow:null
+        }
       },
       // 查询参数
       queryParams: {
@@ -149,7 +174,7 @@ export default {
   },
   created() {
     //申请状态字典
-    this.getDicts("order_searchStatus").then(response => {
+    this.getDicts("order_inlineOrder_status").then(response => {
       this.statusOptions = response.data;
     });
     this.getList();
@@ -175,31 +200,40 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams = {
+        pageNo: 1,
+        pageSize: 10
+      }
       this.handleQuery();
     },
     /** 查看按钮操作 */
     handleCreate(item){
-        this.modal.visibleModal = true
-        this.modal.title = '新增订单'
-        this.modal.action = 'edit'
+        this.modal.create.visibleModal = true
+        this.modal.create.title = '新增订单'
+        this.modal.create.action = 'edit'
+    },
+    /*确定收款*/
+    handlePay(item){
+      this.modal.playpay.visibleModal = true
+      this.modal.playpay.title = '确认收款'
+      this.modal.playpay.action = 'add'
+      this.modal.playpay.selectRow = item
+    },
+    /**订单查看**/
+    handleView(item){
+      this.$router.push({path:"/order/orderDetail/",query:{id:item.guid}})
     },
-    /** 删除按钮操作 */
-    handleDelete(item) {
-      console.log(item)
-      this.$confirm('是否确认删除该数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delApplyItem(item.guid);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(function() {});
+    /**证书查看**/
+    handleCertificate(item){
+
     },
     //窗口关闭
-    closeModal(flag = false){
-      this.modal.visibleModal = false
+    closeCreateModal(flag = false){
+      this.modal.create.visibleModal = false
+      flag && this.getList()
+    },
+    closePlaypayModal(flag = false){
+      this.modal.playpay.visibleModal = false
       flag && this.getList()
     }
   }

+ 51 - 28
src/views/order/inlineOrder/modal/addMobiel.vue

@@ -19,13 +19,23 @@
                  clearable
                  ></el-cascader>
               </el-form-item>
-              <el-form-item label="购买对象:">
-                  <el-autocomplete
-                    v-model="form.applyCustomName"
-                    :fetch-suggestions="querySearchAsync"
-                    placeholder="请输入企业名称"
-                    @select="handleSelect"
-                  ></el-autocomplete>
+              <el-form-item label="购买对象:" prop="applyCostomerId">
+                  <el-select
+                      v-model="form.applyCostomerId"
+                      filterable
+                      remote
+                      reserve-keyword
+                      clearable
+                      placeholder="请输入企业名称"
+                      :remote-method="remoteMethod"
+                      :loading="searchLoading">
+                      <el-option
+                        v-for="item in resultList"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value">
+                      </el-option>
+                    </el-select>
               </el-form-item>
               <el-form-item label="购买类别:" prop="productTypeGuid">
                 <el-checkbox-group v-model="form.productTypeGuid">
@@ -46,7 +56,7 @@
 </template>
 
 <script>
-import { listProductType , areaTree ,createOrder } from "@/api/order/subscription";
+import { listProductType , areaTree ,createOrder , listCustomer } from "@/api/order/subscription";
 export default {
   name: 'addMobiel',
   props: {
@@ -97,8 +107,12 @@ export default {
       buyTypeList:[],
       //验证
       rules: {
-        typeName: [{ required: true, message: '类别名称不能为空!', trigger: 'blur' }]
+        orderCarbonAmount: [{ required: true, message: '碳汇量不能为空!', trigger: 'blur' }],
+        applyCostomerId: [{ required: true, message: '购买对象不能为空!', trigger: 'blur' }],
+        productTypeGuid: [{ required: true, message: '购买类别不能为空!', trigger: 'blur' }],
       },
+      searchLoading:false,
+      resultList:[],
       //行政区域
       areaProps:{
         lazy: true,
@@ -123,9 +137,10 @@ export default {
       },
       //表单
       form: {
-        orderType:1,
+        orderType:2,
         applyCostomerId:'',
-        productTypeGuid:[]
+        productTypeGuid:[],
+        area:[]
       }
     };
   },
@@ -147,28 +162,36 @@ export default {
           }
       });
     },
-    //企业名称搜索
-    querySearchAsync(){
-
+    remoteMethod(querString,callback){
+      this.searchLoading = true;
+      if(querString !== ""){
+          let params = {
+            companyName:querString
+          }
+          listCustomer(params).then(res => {
+              if (res.retHead.errCode === 0) {
+                this.searchLoading = false;
+                this.resultList = res.retBody.map(item =>{
+                  return {value:item.guid,label:item.companyName}
+                })
+              }
+          });
+      }
     },
-    //企业选择
-    handleSelect(){
-
-    }
     //表单提交
     submit() {
       this.$refs.from.validate(valid => {
         if (valid) {
           let params = Object.assign({},this.form)
-          params.villageId = params.area[4]
-          console.log(params)
-            // createOrder(params).then(res => {
-            //     if (res.retHead.errCode === 0) {
-            //       this.msgSuccess("操作成功");
-            //       this.modalVisible = false
-            //      	this.$emit('closeModal', true);
-            //     }
-            // });
+          params.villageId = params.area.length == 0 ? "" : params.area[4]
+          params.productTypeGuid = params.productTypeGuid.join(';')
+          createOrder(params).then(res => {
+              if (res.retHead.errCode === 0) {
+                this.msgSuccess("操作成功");
+                this.modalVisible = false
+                this.$emit('closeCreateModal', true);
+              }
+          });
         } else {
           return false;
         }
@@ -176,7 +199,7 @@ export default {
     },
     //窗口关闭
     handleCancel() {
-      this.$emit('closeModal', false);
+      this.$emit('closeCreateModal', false);
     }
   }
 };

+ 224 - 0
src/views/order/inlineOrder/modal/payMobiel.vue

@@ -0,0 +1,224 @@
+<template>
+  <el-dialog
+    :title="modalTitle"
+    :visible.sync="modalVisible"
+    :width="formLabelWidth"
+    top="2vh"
+    @close="handleCancel">
+    <div class="mobile">
+          <el-form label-width="90px" :model="form" :rules="rules" ref="from" class="from">
+              <el-form-item label="付款银行:" prop="payBank">
+                  <el-input type="text" v-model="form.payBank"></el-input>
+              </el-form-item>
+              <el-form-item label="银行卡号:" prop="payCardNo">
+                  <el-input type="number" v-model="form.payCardNo"></el-input>
+              </el-form-item>
+              <el-form-item label="付款人:" prop="payUserName">
+                  <el-input type="text" v-model="form.payUserName"></el-input>
+              </el-form-item>
+              <el-form-item label="付款时间:" prop="payTime">
+                  <el-date-picker
+                        v-model="form.payTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择日期">
+                      </el-date-picker>
+              </el-form-item>
+              <el-divider content-position="left">附件</el-divider>
+              <div class="uploadImg">
+                 <el-upload
+                   accept=".jpg, .png"
+                   :headers="upload.headers"
+                   :action="upload.url"
+                   :disabled="upload.isUploading"
+                   :on-progress="handleFileUploadProgress"
+                   :on-success="handleFileSuccess"
+                   :file-list="fileList">
+                   <el-button size="small" type="primary">点击上传</el-button>
+                   <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
+                 </el-upload>
+                 <ul class="uploadImgList">
+                   <li v-for="(item,index) in form.voucherImages" :key="index">
+                     <img :src="imgRequest + item + '?imageView2/1/w/200/h/200'">
+                     <span class="del" @click="handelImgRemove(index)" v-if="!limit.isRead"><i class="el-icon-delete-solid"></i></span>
+                   </li>
+                 </ul>
+              </div>
+          </el-form>
+    </div>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="handleCancel">取 消</el-button>
+      <el-button type="primary" @click="submit" v-if="!limit.isRead">确 定</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getToken } from "@/utils/auth";
+import { pay } from "@/api/order/subscription";
+export default {
+  name: 'addMobiel',
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: 'title'
+    },
+    action: {
+      type: String,
+      default: 'add'
+    },
+    selectRow: {
+      type: Object,
+      default:null
+    }
+  },
+  watch: {
+    visible(newVal, oldVal) {
+      this.modalVisible = newVal;
+    },
+    title(newVal, oldVal) {
+      this.modalTitle = newVal;
+    },
+    action(newVal, oldVal) {
+      this.modalAction = newVal;
+    },
+    selectRow(newVal, oldVal) {
+      this.modalSelectRow = newVal;
+    }
+  },
+  data() {
+    return {
+      modalTitle: this.title,
+      modalVisible: this.visible,
+      modalAction: this.action,
+      modalSelectRow: this.selectRow,
+      formLabelWidth: '624px',
+      //窗口权限
+      limit: {
+        isRead: false, //是否只读
+        isAdd: false //是否可写
+      },
+      upload: {
+        // 是否禁用上传
+        isUploading: false,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/system/upload/fileImg",
+      },
+      fileList:[],
+      //购买类型
+      buyTypeList:[],
+      //验证
+      rules: {
+        payBank: [{ required: true, message: '付款银行不能为空!', trigger: 'blur' }],
+        payCardNo: [{ required: true, message: '银行卡号不能为空!', trigger: 'blur' }],
+        payUserName: [{ required: true, message: '付款人不能为空!', trigger: 'blur' }],
+        payTime: [{ required: true, message: '付款时间不能为空!', trigger: 'blur' }]
+      },
+      form: {
+        customerId:'',
+        orderId:'',
+        voucherImages:[]
+      }
+    };
+  },
+  created() {
+    console.log(this.modalSelectRow)
+    this.form.orderId = this.modalSelectRow.guid
+    this.form.customerId = this.modalSelectRow.customerId
+    console.log(this.form)
+    switch (this.modalAction) {
+      case 'add':
+        this.limit.isAdd = true;
+        break;
+      default:
+        break;
+    }
+  },
+  methods: {
+    //表单提交
+    submit() {
+      this.$refs.from.validate(valid => {
+        if (valid) {
+          let params = Object.assign({},this.form)
+          params.voucherImages = params.voucherImages.join(';')
+          pay(params).then(res => {
+              if (res.retHead.errCode === 0) {
+                this.msgSuccess("操作成功");
+                this.modalVisible = false
+                this.$emit('closePlaypayModal', true);
+              }
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    //窗口关闭
+    handleCancel() {
+      this.$emit('closePlaypayModal', false);
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+       this.upload.isUploading = true;
+    },
+    // 上传成功处理
+    handleFileSuccess(response, file, fileList){
+       this.fileList = []
+       this.form.voucherImages.push(response.retBody)
+       this.upload.isUploading = false;
+    },
+    // 图片删除
+    handelImgRemove(i){
+      this.form.voucherImages.splice(i,1)
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.uploadImg{
+      padding:0 30px 30px 30px;
+      .uploadImgList{
+        list-style:none;
+        margin:0;
+        padding:15px 0;
+        display:flex;
+        flex-flow: row;
+        li{
+          position:relative;
+          border:1px solid #ddd;
+          border-radius:6px;
+          width:120px;
+          height:120px;
+          margin-right:13px;
+          img{
+            width:100%;
+            height:100%;
+            border-radius:6px;
+          }
+          .del{
+            display:none;
+            position:absolute;
+            top: -9px;
+            right: -9px;
+            cursor:pointer;
+            i{
+              font-size:20px;
+              color:red;
+            }
+          }
+          &:hover{
+            .del{
+              display:block;
+            }
+          }
+        }
+      }
+    }
+</style>

+ 170 - 0
src/views/order/inlineOrder/orderDetail.vue

@@ -0,0 +1,170 @@
+<template>
+  <div class="orderDetail" v-loading="loading">
+    <div class="orderDetail-box">
+       <div class="orderDetail-box-header">
+          订单信息
+       </div>
+       <div class="orderDetail-box-content">
+          <el-row :gutter="20">
+            <el-col :span="8"><span class="label">订单编号:</span><span class="txt">{{datas.orderNo}}</span></el-col>
+            <el-col :span="8"><span class="label">订单状态:</span><span class="txt">{{datas.orderStatus || '-'}}</span></el-col>
+            <el-col :span="8"><span class="label">下单时间:</span><span class="txt">{{datas.createTime || '-'}}</span></el-col>
+          </el-row>
+       </div>
+    </div>
+    <div class="orderDetail-box">
+       <div class="orderDetail-box-header">
+          客户信息
+       </div>
+       <div class="orderDetail-box-content">
+          <el-row :gutter="20">
+            <el-col :span="8"><span class="label">客户账号:</span><span class="txt">{{datas.account || '-'}}</span></el-col>
+            <el-col :span="8"><span class="label">联系电话:</span><span class="txt">{{datas.phone || '-'}}</span></el-col>
+            <el-col :span="8"><span class="label">客户名称:</span><span class="txt">{{datas.customerName || '-'}}</span></el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="8"><span class="label">客户类型:</span><span class="txt">{{datas.customerTypeName || '-'}}</span></el-col>
+            <el-col :span="8"></el-col>
+            <el-col :span="8"></el-col>
+          </el-row>
+       </div>
+    </div>
+    <div class="orderDetail-box">
+       <div class="orderDetail-box-header">
+          订单商品
+       </div>
+       <div class="orderDetail-box-content">
+          <el-table :data="datas.items" border>
+            <el-table-column label="序号" type="index" width="50" align="center" />
+            <el-table-column label="商品编号" align="center" prop="goodsCode" />
+            <el-table-column label="商品名称" align="center" prop="goodsName"/>
+            <el-table-column label="商品类型" align="center" prop="goodsType"/>
+            <el-table-column label="认购期" align="center" prop="subscriptionDate"/>
+            <el-table-column label="单价" align="center" prop="goodsPrice"/>
+            <el-table-column label="碳汇量(kg)" align="center" prop="saleNum"/>
+            <el-table-column label="金额" align="center" prop="amount"></el-table-column>
+          </el-table>
+          <div class="tableTotal">
+              总计 <span class="num">{{saleNumTotal}}</span> <span class="price">{{priceTotal}}</span>
+          </div>
+       </div>
+    </div>
+    <div class="orderDetail-footer">
+       <el-button type="info" @click="goPage">返回</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { orderDetail } from "@/api/order/subscription";
+  export default{
+    name:"orderDetail",
+    created() {
+      console.log(this.$route.query)
+      this.getDetail();
+    },
+    data(){
+      return{
+        datas:{
+          orderNo:'',
+          items:[],
+        },
+        loading:false,
+        list:[]
+      }
+    },
+    methods:{
+      getDetail(){
+        this.loading = true
+        let params = {
+          guid:this.$route.query.id
+        }
+        orderDetail(params).then(res => {
+            if (res.retHead.errCode === 0) {
+              this.datas = res.retBody
+              this.loading = false
+            }
+        });
+      },
+      goPage(){
+        this.$router.go(-1)
+      }
+    },
+    computed:{
+      //碳汇量计算
+      saleNumTotal(){
+        let totalSumAll = 0;
+        this.datas.items.map((item) => {
+          if(!isNaN(item.saleNum)) totalSumAll += item.saleNum
+        })
+        if(isNaN(totalSumAll)){
+          return 0
+        }
+        return totalSumAll
+      },
+      //总价计算
+      priceTotal(){
+        let totalPrice = 0;
+        this.datas.items.map((item) => {
+          if(!isNaN(item.goodsPrice)) totalPrice += item.goodsPrice
+        })
+        if(isNaN(totalPrice)){
+          return 0
+        }
+        return totalPrice
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .orderDetail{
+    margin:30px 40px;
+    &-box{
+      border-bottom:1px solid #EBEBEB;
+      &-header{
+        margin-top:10px;
+        height:50px;
+        line-height:50px;
+        font-size:16px;
+        font-weight:bold;
+      }
+      &-content{
+        padding-bottom:10px;
+        .el-col{
+          height:35px;
+          line-height:35px;
+          font-size:14px;
+          .label{
+            color:#272727;
+            font-weight:bold;
+            margin-right:10px;
+          }
+          .txt{
+            color:#5A5A5A;
+          }
+        }
+        .tableTotal{
+          position:relative;
+          height:40px;
+          line-height:50px;
+          .num,
+          .price{
+            position:absolute;
+            top:0;
+          }
+          .num{
+            right:320px;
+          }
+          .price{
+            right:90px;
+          }
+        }
+      }
+    }
+    &-footer{
+      text-align:center;
+      padding:15px 0;
+    }
+  }
+</style>

+ 4 - 1
src/views/order/subscription/index.vue

@@ -154,7 +154,10 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
+      this.queryParams = {
+        pageNo: 1,
+        pageSize: 10
+      }
       this.handleQuery();
     },
     /** 查看按钮操作 */

+ 0 - 1
src/views/order/subscription/modal/addMobiel.vue

@@ -155,7 +155,6 @@ export default {
           let params = Object.assign({},this.form)
           params.villageId = params.area.length == 0 ? "" : params.area[4]
           params.productTypeGuid = params.productTypeGuid.join(';')
-          console.log(params)
           createOrder(params).then(res => {
               if (res.retHead.errCode === 0) {
                 this.msgSuccess("操作成功");

+ 2 - 1
vue.config.js

@@ -38,7 +38,8 @@ module.exports = {
         // target: `http://bobo.hw.hongweisoft.com/lymcq`,
         // target: `http://172.16.90.64:21998`,
         // target: `http://172.16.90.102:21998`, //qiubo
-        target: `http://172.16.90.110:21998`, //lql
+        // target: `http://172.16.90.110:21998`, //lql
+        target: `http://172.16.90.8:21998`, //zdd
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''