Browse Source

no message

GeekFish 4 years ago
parent
commit
c2366f3721

+ 9 - 0
src/api/bankCheck/bank.js

@@ -26,3 +26,12 @@ export function bankDetail(query) {
     params: query
   })
 }
+
+//清分明细
+export function bankDetailRequest(query) {
+  return request({
+    url: '/carbon-bank/bank/transfer/detail/request',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+// 查询参数列表
+export function listOrder(query) {
+  return request({
+    url: '/system/web/order/offline-order-list',
+    method: 'get',
+    params: query
+  })
+}
+// 删除
+export function delApplyItem(userId) {
+  return request({
+    url: '/system/back/apply/' + userId,
+    method: 'delete'
+  })
+}
+
+// 查询产品类型
+export function listProductType() {
+  return request({
+    url: '/system/web/productType/all',
+    method: 'get',
+  })
+}
+
+//查询区域树
+export function areaTree(data) {
+  return request({
+    url: '/system/web/position/findByCodeAndLevel',
+    method: 'post',
+    data: data
+  })
+}
+
+//查询区域树
+export function createOrder(data) {
+  return request({
+    url: '/system/web/order/create-order',
+    method: 'post',
+    data: data
+  })
+}
+
+

+ 45 - 0
src/api/order/subscription.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+// 查询参数列表
+export function listApplyList(query) {
+  return request({
+    url: '/system/back/apply/list',
+    method: 'get',
+    params: query
+  })
+}
+// 删除
+export function delApplyItem(userId) {
+  return request({
+    url: '/system/back/apply/' + userId,
+    method: 'delete'
+  })
+}
+
+// 查询产品类型
+export function listProductType() {
+  return request({
+    url: '/system/web/productType/all',
+    method: 'get',
+  })
+}
+
+//查询区域树
+export function areaTree(data) {
+  return request({
+    url: '/system/web/position/findByCodeAndLevel',
+    method: 'post',
+    data: data
+  })
+}
+
+//查询区域树
+export function createOrder(data) {
+  return request({
+    url: '/system/web/order/create-order',
+    method: 'post',
+    data: data
+  })
+}
+
+

+ 4 - 2
src/views/bankCheck/bank/modal/addMobiel.vue

@@ -9,6 +9,7 @@
         <el-table
               border
               :data="list"
+              v-loading="loading"
               style="width: 100%">
               <el-table-column prop="name" label="农户名称" align="center"></el-table-column>
               <el-table-column prop="bankName" label="农户银行名称"></el-table-column>
@@ -148,18 +149,19 @@ export default {
   methods: {
     //获取数据列
     getDetal(id){
+      this.loading = true
       bankDetail(this.queryParams).then(res => {
           if (res.retHead.errCode === 0) {
             this.list = res.retBody
             this.total = res.retHead.total;
+            this.loading = false
           }
       })
     },
     //详情查看
     handleView(item){
-      console.log(item)
       this.modal.visibleModal = true
-      this.modal.title = '清分详情'
+      this.modal.title = '清分明细'
       this.modal.action = 'view'
       this.modal.selectRow = item
     },

+ 90 - 7
src/views/bankCheck/bank/modal/bankOrderMobiel.vue

@@ -6,13 +6,67 @@
     top="2vh"
     append-to-body
     @close="handleCancel">
-    <div class="mobile">
-        <table class="">
+    <div class="mobile" v-loading="loading">
+        <table class="showTables">
           <tr>
-            <td class="title"></td>
-            <td class="content"></td>
-            <td class="title"></td>
-            <td class="content"></td>
+            <td class="title">账户余额:</td>
+            <td class="content">{{datas.accountMoney}}</td>
+            <td class="title">渠道流水号:</td>
+            <td class="content">{{datas.chaSerialNo}}</td>
+            <td class="title">币种:</td>
+            <td class="content">{{datas.currency}}</td>
+          </tr>
+          <tr>
+            <td class="title">手续费支付方式:</td>
+            <td class="content">{{datas.handFeeType}}</td>
+            <td class="title">手续费:</td>
+            <td class="content">{{datas.handFee}}</td>
+            <td class="title">付款账号:</td>
+            <td class="content">{{datas.payAccount}}</td>
+          </tr>
+          <tr>
+            <td class="title">付款人名称:</td>
+            <td class="content">{{datas.payName}}</td>
+            <td class="title">交易应答码:</td>
+            <td class="content">{{datas.payResponseCode}}</td>
+            <td class="title">交易序号:</td>
+            <td class="content">{{datas.paySerial}}</td>
+          </tr>
+          <tr>
+            <td class="title">付款金额:</td>
+            <td class="content">{{datas.payAmount}}</td>
+            <td class="title">付款银行名称:</td>
+            <td class="content">{{datas.payBankName}}</td>
+            <td class="title">交易日期:</td>
+            <td class="content">{{datas.payDate}}</td>
+          </tr>
+          <tr>
+            <td class="title">交易状态:</td>
+            <td class="content">{{datas.payStatus}}</td>
+            <td class="title">邮电费:</td>
+            <td class="content">{{datas.postFee}}</td>
+            <td class="title">交易类型:</td>
+            <td class="content">{{datas.transactionType}}</td>
+          </tr>
+          <tr>
+            <td class="title">加急标志:</td>
+            <td class="content" colspan="6">{{datas.urgentSign}}</td>
+          </tr>
+          <tr>
+            <td class="title">用途:</td>
+            <td class="content" colspan="6">{{datas.useWay}}</td>
+          </tr>
+          <tr>
+            <td class="title">付款人备注:</td>
+            <td class="content" colspan="6">{{datas.payMark}}</td>
+          </tr>
+          <tr>
+            <td class="title">错误消息:</td>
+            <td class="content" colspan="6">{{datas.errorMsg}}</td>
+          </tr>
+          <tr>
+            <td class="title">失败原因:</td>
+            <td class="content" colspan="6">{{datas.failReson}}</td>
           </tr>
         </table>
     </div>
@@ -23,6 +77,7 @@
 </template>
 
 <script>
+import { bankDetailRequest } from "@/api/bankCheck/bank";
 export default {
   name: 'addMobiel',
   props: {
@@ -64,17 +119,31 @@ export default {
       modalAction: this.action,
       modalSelectRow: this.selectRow,
       formLabelWidth: '1024px',
+      loading:false,
       //窗口权限
       limit: {
         isRead: false, //是否只读
         isAdd: false //是否可写
       },
+      datas:null
     };
   },
   created() {
-
+    this.getDetail(this.modalSelectRow.guid)
   },
   methods: {
+    getDetail(id){
+      this.loading = true;
+      let params = {
+        guid:id
+      }
+      bankDetailRequest(params).then(res => {
+          if (res.retHead.errCode === 0) {
+            this.datas = res.retBody
+            this.loading = false;
+          }
+      })
+    },
     //窗口关闭
     handleCancel() {
       this.$emit('closemodal', false);
@@ -84,4 +153,18 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+  .showTables{
+    width:100%;
+    text-align:center;
+    border-collapse: collapse;
+    tr,td{
+      height:42px;
+      border:1px solid #EFEFEF;
+    }
+    .title{
+      background:#FAFAFA;
+      color:#666;
+      font-weight:bold;
+    }
+  }
 </style>

+ 0 - 3
src/views/belongToSubject/area/modal/addMobiel.vue

@@ -123,9 +123,6 @@ export default {
         povertyAreaName: [{ required: true, message: '区域名称不能为空!', trigger: 'blur' }],
         areaAdd: [{ required: true, message: '行政区域 不能为空!', trigger: 'blur' }]
       },
-      //属性
-      inputVisible: false,
-      inputValue:'',
       //行政区域
       areaProps:{
         lazy: true,

+ 207 - 0
src/views/order/inlineOrder/index.vue

@@ -0,0 +1,207 @@
+<template>
+  <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form-item>
+          <el-select
+            v-model="queryParams.applyStatus"
+            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-input
+            v-model="queryParams.applyCustomName"
+            placeholder="请输入企业账号"
+            clearable
+            size="small"
+            style="width: 240px"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-input
+            v-model="queryParams.applyCustomName"
+            placeholder="请输入企业名称"
+            clearable
+            size="small"
+            style="width: 240px"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-input
+            v-model="queryParams.applyCustomName"
+            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-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-button
+            type="primary"
+            size="mini"
+            @click="handleCreate"
+          >新增订单</el-button>
+        </el-col>
+        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      </el-row>
+      <el-table v-loading="loading" :data="list">
+        <el-table-column label="序号" type="index" width="50" align="center" />
+        <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="payAmount"/>
+        <el-table-column label="购买碳汇量(kg)" align="center" prop="orderCarbonAmount"/>
+        <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="orderType"/>
+        <el-table-column label="订单状态" align="center" prop="orderStatus"></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="primary"
+              @click="handleCreate(scope.row)"
+            >确认收款</el-button>
+            <el-button
+              size="mini"
+              type="danger"
+              @click="handleDelete(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"
+      />
+      <add-mobiel
+      			v-if="modal.visibleModal"
+      			:title="modal.title"
+      			:action="modal.action"
+      			:visible="modal.visibleModal"
+      			@closeModal="closeModal">
+      		</add-mobiel>
+  </div>
+</template>
+<script>
+import { listOrder , delApplyItem , areaTree} from "@/api/order/inlineOrder";
+import addMobiel from './modal/addMobiel'
+export default {
+  name: "inlineOrder",
+  components: {
+    addMobiel
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 表格数据
+      list: null,
+      // 状态数据字典
+      statusOptions: [],
+      // 表单参数
+      form: {},
+      //弹出层
+      modal:{
+        action:'',
+        title:'',
+        visibleModal:false,
+      },
+      // 查询参数
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10
+      }
+    };
+  },
+  created() {
+    //申请状态字典
+    this.getDicts("order_searchStatus").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    /** 查询列表 */
+    getList() {
+      this.loading = true;
+      listOrder(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();
+    },
+    /** 查看按钮操作 */
+    handleCreate(item){
+        this.modal.visibleModal = true
+        this.modal.title = '新增订单'
+        this.modal.action = 'edit'
+    },
+    /** 删除按钮操作 */
+    handleDelete(item) {
+      console.log(item)
+      this.$confirm('是否确认删除该数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delApplyItem(item.guid);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    //窗口关闭
+    closeModal(flag = false){
+      this.modal.visibleModal = false
+      flag && this.getList()
+    }
+  }
+};
+</script>

+ 187 - 0
src/views/order/inlineOrder/modal/addMobiel.vue

@@ -0,0 +1,187 @@
+<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="orderCarbonAmount">
+                  <el-input type="text" v-model="form.orderCarbonAmount" :disabled="limit.isRead"></el-input>
+              </el-form-item>
+              <el-form-item label="购买区域:">
+                <el-cascader
+                 ref="areaSelect"
+                 v-model="form.area"
+                 style="width:100%;"
+                 :props="areaProps"
+                 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>
+              <el-form-item label="购买类别:" prop="productTypeGuid">
+                <el-checkbox-group v-model="form.productTypeGuid">
+                    <el-checkbox
+                      v-for="(item,index) in buyTypeList"
+                      :label="item.guid"
+                      :key="index"
+                      >{{item.type_name}}</el-checkbox>
+                </el-checkbox-group>
+              </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>
+import { listProductType , areaTree ,createOrder } 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 //是否可写
+      },
+      //购买类型
+      buyTypeList:[],
+      //验证
+      rules: {
+        typeName: [{ required: true, message: '类别名称不能为空!', trigger: 'blur' }]
+      },
+      //行政区域
+      areaProps:{
+        lazy: true,
+        checkStrictly:false,
+        lazyLoad (node, resolve) {
+          if (node.level === 0) {
+             resolve( [{ label: '重庆市',value:'156050',leaf:false }] );
+          }else{
+             let params = {
+               upCode:node.data.value
+             }
+             areaTree(params).then(res => {
+                const areas = res.retBody.map((value,i) => ({
+                   value:value.code,
+                   label:value.name,
+                   leaf:value.level >= 5
+                }))
+                resolve(areas)
+             })
+          }
+        }
+      },
+      //表单
+      form: {
+        orderType:1,
+        applyCostomerId:'',
+        productTypeGuid:[]
+      }
+    };
+  },
+  created() {
+    switch (this.modalAction) {
+      case 'edit':
+        this.limit.isAdd = true;
+        this.getType()
+        break;
+      default:
+        break;
+    }
+  },
+  methods: {
+    getType(){
+      listProductType().then(res => {
+          if (res.retHead.errCode === 0) {
+            this.buyTypeList = res.retBody
+          }
+      });
+    },
+    //企业名称搜索
+    querySearchAsync(){
+
+    },
+    //企业选择
+    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);
+            //     }
+            // });
+        } else {
+          return false;
+        }
+      });
+    },
+    //窗口关闭
+    handleCancel() {
+      this.$emit('closeModal', false);
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 192 - 0
src/views/order/subscription/index.vue

@@ -0,0 +1,192 @@
+<template>
+  <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form-item>
+          <el-input
+            v-model="queryParams.applyCustomName"
+            placeholder="请输入企业名称"
+            clearable
+            size="small"
+            style="width: 240px"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            v-model="queryParams.applyStatus"
+            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-date-picker
+            v-model="queryParams.applyDate"
+            value-format="yyyy-MM-dd"
+            type="date"
+            placeholder="选择日期">
+          </el-date-picker>
+        </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="applyCustomName" />
+        <el-table-column label="认购数量(kg)" align="center" prop="amount"/>
+        <el-table-column label="备注说明" align="center" prop="remark"/>
+        <el-table-column label="申请日期" align="center" prop="applyDate">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.applyDate) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="申请状态" align="center" prop="applyStatus" :formatter="statusFormat"></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="primary"
+              icon="el-icon-view"
+              v-if="scope.row.applyStatus != 1"
+              @click="handleCreate(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 { listApplyList , delApplyItem , areaTree} from "@/api/order/subscription";
+import addMobiel from './modal/addMobiel'
+export default {
+  name: "subscription",
+  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.getDicts("order_searchStatus").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    /** 查询列表 */
+    getList() {
+      this.loading = true;
+      listApplyList(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();
+    },
+    /** 查看按钮操作 */
+    handleCreate(item){
+        this.modal.visibleModal = true
+        this.modal.title = '订单生成'
+        this.modal.action = 'edit'
+        this.modal.selectRow = item
+    },
+    /** 删除按钮操作 */
+    handleDelete(item) {
+      console.log(item)
+      this.$confirm('是否确认删除该数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delApplyItem(item.guid);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    // 字典状态字典翻译
+    statusFormat(row, column) {
+      return this.selectDictLabel(this.statusOptions, row.applyStatus);
+    },
+    //窗口关闭
+    closeModal(flag = false){
+      this.modal.visibleModal = false
+      flag && this.getList()
+    }
+  }
+};
+</script>

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

@@ -0,0 +1,181 @@
+<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="orderCarbonAmount">
+                  <el-input type="text" v-model="form.orderCarbonAmount" :disabled="limit.isRead"></el-input>
+              </el-form-item>
+              <el-form-item label="购买区域:">
+                <el-cascader
+                 ref="areaSelect"
+                 v-model="form.area"
+                 style="width:100%;"
+                 :props="areaProps"
+                 clearable
+                 ></el-cascader>
+              </el-form-item>
+              <el-form-item label="购买对象:">
+                  <el-input type="text" v-model="form.applyCustomName" :disabled="true"></el-input>
+              </el-form-item>
+              <el-form-item label="购买类别:" prop="productTypeGuid">
+                <el-checkbox-group v-model="form.productTypeGuid">
+                    <el-checkbox
+                      v-for="(item,index) in buyTypeList"
+                      :label="item.guid"
+                      :key="index"
+                      >{{item.type_name}}</el-checkbox>
+                </el-checkbox-group>
+              </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>
+import { listProductType , areaTree ,createOrder } 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 //是否可写
+      },
+      //购买类型
+      buyTypeList:[],
+      //验证
+      rules: {
+        orderCarbonAmount: [{ required: true, message: '购买碳汇量不能为空!', trigger: 'blur' }],
+        productTypeGuid: [{ required: true, message: ' 购买类别不能为空!', trigger: 'blur' }]
+      },
+      //行政区域
+      areaProps:{
+        lazy: true,
+        checkStrictly:false,
+        lazyLoad (node, resolve) {
+          if (node.level === 0) {
+             resolve( [{ label: '重庆市',value:'156050',leaf:false }] );
+          }else{
+             let params = {
+               upCode:node.data.value
+             }
+             areaTree(params).then(res => {
+                const areas = res.retBody.map((value,i) => ({
+                   value:value.code,
+                   label:value.name,
+                   leaf:value.level >= 5
+                }))
+                resolve(areas)
+             })
+          }
+        }
+      },
+      //表单
+      form: {
+        orderType:1,
+        applyCostomerId:'',
+        productTypeGuid:[],
+        area:[]
+      }
+    };
+  },
+  created() {
+    switch (this.modalAction) {
+      case 'edit':
+        this.limit.isAdd = true;
+        this.form.orderCarbonAmount = this.modalSelectRow.amount
+        this.form.applyCostomerId = this.modalSelectRow.applyCustomerId
+        this.form.guid = this.modalSelectRow.guid
+        this.form.applyCustomName = this.modalSelectRow.applyCustomName
+        this.getType()
+        break;
+      default:
+        break;
+    }
+  },
+  methods: {
+    getType(){
+      listProductType().then(res => {
+          if (res.retHead.errCode === 0) {
+            this.buyTypeList = res.retBody
+          }
+      });
+    },
+    //表单提交
+    submit() {
+      this.$refs.from.validate(valid => {
+        if (valid) {
+          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("操作成功");
+                this.modalVisible = false
+                this.$emit('closeModal', true);
+              }
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    //窗口关闭
+    handleCancel() {
+      this.$emit('closeModal', false);
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 2 - 2
src/views/system/config/index.vue

@@ -117,14 +117,14 @@
         <template slot-scope="scope">
           <el-button
             size="mini"
-            type="text"
+            type="success"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:config:edit']"
           >修改</el-button>
           <el-button
             size="mini"
-            type="text"
+            type="danger"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:config:remove']"

+ 10 - 10
src/views/system/dept/index.vue

@@ -56,24 +56,24 @@
       </el-table-column>
       <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" 
+          <el-button
+            size="mini"
+            type="success"
+            icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:dept:edit']"
           >修改</el-button>
-          <el-button 
-            size="mini" 
-            type="text" 
-            icon="el-icon-plus" 
+          <el-button
+            size="mini"
+            type="primary"
+            icon="el-icon-plus"
             @click="handleAdd(scope.row)"
             v-hasPermi="['system:dept:add']"
           >新增</el-button>
           <el-button
             v-if="scope.row.parentId != 0"
             size="mini"
-            type="text"
+            type="danger"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:dept:remove']"
@@ -313,4 +313,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 3 - 3
src/views/system/dict/index.vue

@@ -128,14 +128,14 @@
         <template slot-scope="scope">
           <el-button
             size="mini"
-            type="text"
+            type="success"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:dict:edit']"
           >修改</el-button>
           <el-button
             size="mini"
-            type="text"
+            type="danger"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:dict:remove']"
@@ -350,4 +350,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 9 - 9
src/views/system/menu/index.vue

@@ -62,22 +62,22 @@
       </el-table-column>
       <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" 
+          <el-button size="mini"
+            type="success"
+            icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:menu:edit']"
           >修改</el-button>
-          <el-button 
-            size="mini" 
-            type="text" 
-            icon="el-icon-plus" 
+          <el-button
+            size="mini"
+            type="primary"
+            icon="el-icon-plus"
             @click="handleAdd(scope.row)"
             v-hasPermi="['system:menu:add']"
           >新增</el-button>
           <el-button
             size="mini"
-            type="text"
+            type="danger"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:menu:remove']"
@@ -396,4 +396,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 3 - 3
src/views/system/notice/index.vue

@@ -101,14 +101,14 @@
         <template slot-scope="scope">
           <el-button
             size="mini"
-            type="text"
+            type="success"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:notice:edit']"
           >修改</el-button>
           <el-button
             size="mini"
-            type="text"
+            type="danger"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:notice:remove']"
@@ -337,4 +337,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 4 - 4
src/views/system/post/index.vue

@@ -93,14 +93,14 @@
         <template slot-scope="scope">
           <el-button
             size="mini"
-            type="text"
+            type="success"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:post:edit']"
           >修改</el-button>
           <el-button
             size="mini"
-            type="text"
+            type="danger"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:post:remove']"
@@ -108,7 +108,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -312,4 +312,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 4 - 4
src/views/system/role/index.vue

@@ -122,21 +122,21 @@
         <template slot-scope="scope">
           <el-button
             size="mini"
-            type="text"
+            type="primary"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:role:edit']"
           >修改</el-button>
           <el-button
             size="mini"
-            type="text"
+            type="warning"
             icon="el-icon-circle-check"
             @click="handleDataScope(scope.row)"
             v-hasPermi="['system:role:edit']"
           >数据权限</el-button>
           <el-button
             size="mini"
-            type="text"
+            type="danger"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:role:remove']"
@@ -585,4 +585,4 @@ export default {
     }
   }
 };
-</script>
+</script>

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

@@ -158,13 +158,13 @@
           <el-table-column
             label="操作"
             align="center"
-            width="160"
+            width="220"
             class-name="small-padding fixed-width"
           >
             <template slot-scope="scope">
               <el-button
                 size="mini"
-                type="text"
+                type="success"
                 icon="el-icon-edit"
                 @click="handleUpdate(scope.row)"
                 v-hasPermi="['system:user:edit']"
@@ -172,14 +172,14 @@
               <el-button
                 v-if="scope.row.userId !== 1"
                 size="mini"
-                type="text"
+                type="danger"
                 icon="el-icon-delete"
                 @click="handleDelete(scope.row)"
                 v-hasPermi="['system:user:remove']"
               >删除</el-button>
               <el-button
                 size="mini"
-                type="text"
+                type="warning"
                 icon="el-icon-key"
                 @click="handleResetPwd(scope.row)"
                 v-hasPermi="['system:user:resetPwd']"
@@ -655,4 +655,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 2 - 2
vue.config.js

@@ -37,8 +37,8 @@ module.exports = {
         // target: `http://172.16.90.94:21998`,
         // 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.3:21998`, //lql
+        // target: `http://172.16.90.102:21998`, //qiubo
+        target: `http://172.16.90.110:21998`, //lql
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''