Jelajahi Sumber

订单新增优惠券抵扣

qymljy 2 tahun lalu
induk
melakukan
92879d061e

+ 15 - 3
src/SManagement/user/pay-orders/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="container normal-panel normal-margin  flex-between">
-      <add @onSuccess="onSuccess" v-if="tool.checkAuth($route.name,'insert')" ref="add"></add>
+      <add @onSuccess="onSuccess" @addSuccess="addSuccess" v-if="tool.checkAuth($route.name,'insert')" ref="add"></add>
       <payment ref="payment" v-if="tool.checkAuth($route.name,'insert')" @closeSuccess="listData(param.content.pageNumber = 1)"></payment>
     </div>
     <div class="container normal-panel">
@@ -61,6 +61,7 @@ export default {
         "classname": "system.payorder.payorder",
         "method": "list",
         "content": {
+          "nocache":false,
           "pageNumber": 1,
           "pageSize": 20,
           "where": {
@@ -78,7 +79,6 @@ export default {
   methods: {
     async listData(){
       const res = await this.$api.requested(this.param)
-      console.log(res,'订单列表')
       this.list = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
@@ -107,6 +107,19 @@ export default {
         }
       })
     },
+    async addSuccess(orderno){
+      this.$confirm('优惠后金额为0,是否确认?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.payment.queryCode(orderno)
+        this.$refs.add.dialogVisible = false
+        this.listData(this.param.content.pageNumber = 1)
+      }).catch(() => {
+        this.$refs.add.dialogVisible = false
+      });
+    },
     async queryAuth(){
       const res = await this.$api.requested({
         "classname": "system.payorder.payorder",
@@ -116,7 +129,6 @@ export default {
         }
       })
       this.auth_data = res.data
-      console.log(this.auth_data)
       sessionStorage.setItem('module_info', JSON.stringify(this.auth_data))
     },
     handleSizeChange(val) {

+ 164 - 74
src/SManagement/user/pay-orders/modules/add.vue

@@ -25,68 +25,6 @@
             </el-option>
           </el-select>
         </el-col>
-<!--        <el-col :span="24" class="div_top">
-&lt;!&ndash;          <el-table
-              :data="versionList"
-              height="300px"
-              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}"
-              :header-cell-style="{height:'40px',color:'#333',fontWeight:'400',fontSize:'14px',background:'#EEEEEE'}"
-              @row-click="rowClick"
-              style="width: 100%">
-            <el-table-column
-                prop="partitionname"
-                label="版本名称"
-                >
-            </el-table-column>
-            <el-table-column
-                prop="operation"
-                label="操作"
-                width="120">
-              <template slot-scope="scope">
-                <input type="radio" :checked="scope.row.checkRow" @click="onCheck(scope.row)"></input>
-              </template>
-            </el-table-column>
-          </el-table>&ndash;&gt;
-          <tableLayout ref="version" :layout="tablecolsVersion" :data="versionList"  :opwidth="200" :custom="true"   fixedName="operation" @rowClick="rowClick">
-            <template v-slot:customcol="scope">
-              <span v-if="scope.column.columnname === 'operation'" ></span>
-              <p v-else>{{scope.column.data[scope.column.columnname] || '&#45;&#45;'}}</p>
-            </template>
-            <template v-slot:opreation="scope">
-              <input type="radio" :checked="scope.data.checkRow" @click="onCheck(scope.data)"></input>
-            </template>
-          </tableLayout>
-        </el-col>-->
-<!--        <el-col :span="14" class="div_top">
-          <el-table
-              :data="modulesList"
-              height="300px"
-              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}"
-              :header-cell-style="{height:'40px',color:'#333',fontWeight:'400',fontSize:'14px',background:'#EEEEEE'}"
-              style="width: 100%">
-            <el-table-column
-                prop="systemclient"
-                label="端口"
-            >
-            </el-table-column>
-            <el-table-column
-                prop="systemname"
-                label="系统名称"
-               >
-            </el-table-column>
-            <el-table-column
-                prop="systemmodulename"
-                label="模块名称"
-            >
-            </el-table-column>
-            <el-table-column
-                prop="systemappname"
-                label="应用名称"
-               >
-            </el-table-column>
-          </el-table>
-
-        </el-col>-->
         <el-col :span="24" class="div_top">
           <span style="color: red">*</span>
           <span>选择付费账号:</span>
@@ -152,14 +90,70 @@
             </el-form-item>
           </el-form>
         </el-col>
+        <el-col :span="24" >
+          <el-form :model="form"   ref="form" label-width="90px" label-position="right" size="mini" style="font-weight: bold;font-size: 15px!important;">
+            <el-col :span="24"><span>使用抵扣券:</span></el-col>
+            <el-row>
+              <el-col :span="6" v-for="item in couponList" :key="item.index" style="margin-right: 30px">
+                <div class="card" :style="{background: useColor}" v-if="item.rowindex <= usAccountNum">
+                  <div class="card-left">抵扣一年</div>
+                  <div class="card-right">
+                    <p class="card-info">账号优惠券</p>
+                    <strong class="card-time">有效期至{{item.enddate}}</strong>
+                  </div>
+                </div>
+                <div class="card" :style="{background: bgColor}" v-else>
+                  <div class="card-left">抵扣一年</div>
+                  <div class="card-right">
+                    <p class="card-info">账号优惠券</p>
+                    <strong class="card-time">有效期至{{item.enddate}}</strong>
+                  </div>
+                </div>
+              </el-col>
+            </el-row>
+
+
+<!--            <el-form-item label="使用抵扣券:" style="font-size: 20px">
+
+            </el-form-item>-->
+          </el-form>
+        </el-col>
       </el-row>
+      <div style="margin-top: 20px;margin-bottom: -20px">
+        <el-row>
+          <el-col :sapn="24">
+            <div style="float: right;margin-top: 10px">
+              账号数:<span style="color: red">{{accountNum}}</span>
+            </div>
+          </el-col>
+          <el-col :sapn="24">
+            <div style="float: right;margin-top: 10px">
+              原价:<span style="color: red">¥{{orig_amount}}</span>
+            </div>
+          </el-col>
+          <el-col :sapn="24">
+            <div style="float: right;margin-top: 10px" v-if="coupon_amount === 0">
+              优惠券抵扣:<span style="color: red">¥{{coupon_amount}}</span>
+            </div>
+            <div style="float: right;margin-top: 10px" v-else>
+              优惠券抵扣:<span style="color: red">-¥{{tool.formatAmount(coupon_amount,2)}}</span>
+            </div>
+          </el-col>
+          <el-col :sapn="24">
+            <div style="float: right;margin-top: 10px">
+              应付总额:<span style="color: red;font-size: 18px">¥{{amount}}</span>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+
       <span slot="footer" class="dialog-footer">
-        <span >共</span>
+<!--        <span >共</span>
         <span style="color: red">{{accountNum}}</span>
          <span style="margin-right: 10px">个账号</span>
         <span >总价:</span>
-        <span style="color: red;margin-right: 10px">¥{{amount}}</span>
-        <el-button type="danger" @click="onSubmit" :disabled="userids.length === 0">生成订单</el-button>
+        <span style="color: red;margin-right: 10px">¥{{amount}}</span>-->
+        <el-button type="danger" @click="onSubmit" :disabled="userids.length === 0">提交订单</el-button>
       </span>
     </el-dialog>
   </div>
@@ -171,10 +165,14 @@ export default {
   name: "add",
   data() {
     return {
+      // bgColor:linear-gradient(45deg, orange, red),
+      bgColor:'linear-gradient(45deg, grey, grey)',
+      useColor:'linear-gradient(45deg, orange, red)',
       dialogVisible:false,
       dataNow:'',
       versionList:[],
       modulesList:[],
+      couponList:[],
       form:{
         "sys_site_systempartitionid": '',
         "orderno":'',
@@ -201,7 +199,10 @@ export default {
       sys_payincidence:'',
       userids:[],
       accountNum:0,
+      usAccountNum:0,
       amount:0,
+      orig_amount:0,
+      coupon_amount:0,
       createNow:false,
       sys_payswitch:'1',
       userLeader:'',
@@ -215,6 +216,7 @@ export default {
 
       /*this.queryAccount()*/
       this.queryInstructions()
+      this.queryCoupon()
       this.creatOrder()
       /*this.queryVersion()*/
     },
@@ -338,6 +340,11 @@ export default {
           }
         })
         this.accountNum = this.userids.length
+        let newLength = this.userids.filter(item=>{
+          return item.isleader !== 1
+        })
+        console.log(newLength,'newL')
+        this.usAccountNum = newLength.length
         this.queryPrice()
         this.$refs.account1.$refs.myTable.doLayout()
         this.$refs.account2.$refs.myTable.doLayout()
@@ -367,6 +374,11 @@ export default {
           }
         })
         this.accountNum = this.userids.length
+        let newLength = this.userids.filter(item=>{
+          return item.isleader !== 1
+        })
+        console.log(newLength,'newL1')
+        this.usAccountNum = newLength.length
         this.queryPrice()
         this.$refs.account1.$refs.myTable.doLayout()
         this.$refs.account2.$refs.myTable.doLayout()
@@ -375,7 +387,6 @@ export default {
     },
     /*选择版本*/
     onCheck(val){
-      console.log(val,'选择版本')
       this.userLeader = ''
       this.userids = []
       this.form.sys_site_systempartitionid = val
@@ -414,6 +425,10 @@ export default {
         }
       })
       this.accountNum = this.userids.length
+      let newLength = this.userids.filter(item=>{
+        return item.isleader !== 1
+      })
+      this.usAccountNum = newLength.length
       this.queryPrice()
     },
     rowClick(val){
@@ -436,14 +451,35 @@ export default {
         },
       })
       this.amount = res.data.amount
+      this.orig_amount = res.data.orig_amount
+      if (this.couponList.length > 0){
+        this.coupon_amount = res.data.orig_amount - res.data.amount
+      }else {
+        this.coupon_amount = 0
+      }
       if (this.createNow){
-        this.dialogVisible = false
-        this.createNow = false
-        this.amount = 0
-        this.userLeader = ''
-        this.form.remarks = ''
-        this.accountNum = 0
-        this.$emit('onSuccess',this.form.sys_payorderid,this.form.orderno)
+        if (this.amount === 0){
+          this.createNow = false
+          this.amount = 0
+          this.orig_amount = 0
+          this.coupon_amount = 0
+          this.userLeader = ''
+          this.form.remarks = ''
+          this.accountNum = 0
+          this.usAccountNum = 0
+          this.$emit('addSuccess',this.form.orderno)
+        }else {
+          this.dialogVisible = false
+          this.createNow = false
+          this.amount = 0
+          this.orig_amount = 0
+          this.coupon_amount = 0
+          this.userLeader = ''
+          this.form.remarks = ''
+          this.accountNum = 0
+          this.usAccountNum = 0
+          this.$emit('onSuccess',this.form.sys_payorderid,this.form.orderno)
+        }
       }
     },
     onClose(){
@@ -452,7 +488,18 @@ export default {
       this.userLeader = ''
       this.form.remarks = ''
       this.amount = 0
+      this.orig_amount = 0
+      this.coupon_amount = 0
       this.accountNum = 0
+      this.usAccountNum = 0
+    },
+    /*可使用优惠券*/
+    async queryCoupon(){
+      const res = await this.$api.requested({
+        "id": 20230801162402,
+        "content": {},
+      })
+      this.couponList = res.data
     }
   },
   created() {
@@ -462,7 +509,50 @@ export default {
   }
 }
 </script>
-
+<style>
+.card{
+  display: flex;
+  align-items: center;
+  margin: 15px 0 10px 0;
+  width: 100%;
+  height: 50px;
+  padding: 10px 0;
+  background: #fff;
+  border-radius: 8px;
+  -webkit-mask-image: radial-gradient(circle at 88px 4px, transparent 4px, red 4.5px),radial-gradient(closest-side circle at 50%, red 99%, transparent 100%);
+  -webkit-mask-size: 100%, 2px 4px;
+  -webkit-mask-repeat: repeat, repeat-y;
+  -webkit-mask-position: 0 -4px, 87px;
+  -webkit-mask-composite: source-out;
+  mask-composite: subtract;
+  background: linear-gradient(45deg, orange, red);
+}
+.card-left{
+  width: 88px;
+  text-align: center;
+  font-size: 18px;
+  color: #fff;
+}
+.card-right{
+  padding: 16px 12px;
+  display: flex;
+  flex: 1;
+  flex-direction: column;
+}
+.card-info{
+  margin: 0 0 10px 0;
+  font-size: 14px;
+  line-height: 20px;
+  color:#fff;
+}
+.card-time{
+  font-size: 12px;
+  line-height: 16px;
+  font-weight: normal;
+  color: #fff;
+  margin-top: 4px;
+}
+</style>
 <style scoped>
  /deep/ .el-dialog__title {
    line-height: 24px;

+ 489 - 0
src/SManagement/user/pay-orders/modules/addCopy.vue

@@ -0,0 +1,489 @@
+<template>
+  <div>
+    <el-button class="inline-24" type="primary" size="small"  @click="onShow" v-if="sys_payswitch == 1 && tool.checkAuth($route.name,'insert')" >新建付费订单</el-button>
+    <el-dialog
+        title="付费订单"
+        :visible.sync="dialogVisible"
+        width="980px"
+        @close="onClose"
+       >
+      <el-row :gutter="20" style="margin-top: -20px">
+        <el-col :span="24" v-if="payInstructions">
+          <div class="pay_border">
+            <span class="pay_font">付费说明:{{payInstructions}}</span>
+          </div>
+        </el-col>
+        <el-col :span="24" class="div_top">
+          <span style="color: red">*</span>
+          <span>选择版本:</span>
+          <el-select style="margin-left: 10px" size="small" v-model="version" placeholder="请选择" @change="onCheck">
+            <el-option
+                v-for="item in versionList"
+                :key="item.sys_site_systempartitionid"
+                :label="item.partitionname"
+                :value="item.sys_site_systempartitionid">
+            </el-option>
+          </el-select>
+        </el-col>
+<!--        <el-col :span="24" class="div_top">
+&lt;!&ndash;          <el-table
+              :data="versionList"
+              height="300px"
+              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}"
+              :header-cell-style="{height:'40px',color:'#333',fontWeight:'400',fontSize:'14px',background:'#EEEEEE'}"
+              @row-click="rowClick"
+              style="width: 100%">
+            <el-table-column
+                prop="partitionname"
+                label="版本名称"
+                >
+            </el-table-column>
+            <el-table-column
+                prop="operation"
+                label="操作"
+                width="120">
+              <template slot-scope="scope">
+                <input type="radio" :checked="scope.row.checkRow" @click="onCheck(scope.row)"></input>
+              </template>
+            </el-table-column>
+          </el-table>&ndash;&gt;
+          <tableLayout ref="version" :layout="tablecolsVersion" :data="versionList"  :opwidth="200" :custom="true"   fixedName="operation" @rowClick="rowClick">
+            <template v-slot:customcol="scope">
+              <span v-if="scope.column.columnname === 'operation'" ></span>
+              <p v-else>{{scope.column.data[scope.column.columnname] || '&#45;&#45;'}}</p>
+            </template>
+            <template v-slot:opreation="scope">
+              <input type="radio" :checked="scope.data.checkRow" @click="onCheck(scope.data)"></input>
+            </template>
+          </tableLayout>
+        </el-col>-->
+<!--        <el-col :span="14" class="div_top">
+          <el-table
+              :data="modulesList"
+              height="300px"
+              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}"
+              :header-cell-style="{height:'40px',color:'#333',fontWeight:'400',fontSize:'14px',background:'#EEEEEE'}"
+              style="width: 100%">
+            <el-table-column
+                prop="systemclient"
+                label="端口"
+            >
+            </el-table-column>
+            <el-table-column
+                prop="systemname"
+                label="系统名称"
+               >
+            </el-table-column>
+            <el-table-column
+                prop="systemmodulename"
+                label="模块名称"
+            >
+            </el-table-column>
+            <el-table-column
+                prop="systemappname"
+                label="应用名称"
+               >
+            </el-table-column>
+          </el-table>
+
+        </el-col>-->
+        <el-col :span="24" class="div_top">
+          <span style="color: red">*</span>
+          <span>选择付费账号:</span>
+        </el-col>
+        <el-col :span="24" class="div_top" v-if="sys_payincidence == '1'">
+          <tableLayout ref="account1" :layout="tablecolsAccount" :data="list"  :opwidth="200" :custom="true"  :height="'240px'" fixedName="operation">
+            <template v-slot:customcol="scope">
+              <span v-if="scope.column.columnname === 'operation'" ></span>
+              <span v-else-if="scope.column.columnname === 'enddate'">
+                <span v-for="(item,index) in scope.column.data.enddate" :key="index">
+                  <span v-if="form.sys_site_systempartitionid == index">{{item}}</span>
+                </span>
+              </span>
+              <span v-else-if="scope.column.columnname === 'name'">
+                <span v-if="JSON.stringify(scope.column.data.enddate) === '{}'">
+                  <span style="margin-right: 10px">{{scope.column.data.name}}</span>
+                  <el-tag type="danger" size="mini">未付费</el-tag>
+                </span>
+                <span v-else>
+                  <span v-if="dataNow > JSON.stringify(scope.column.data.enddate)">
+                     <span style="margin-right: 10px">{{scope.column.data.name}}</span>
+                      <el-tag type="danger" size="mini">未付费</el-tag>
+                  </span>
+                  <span v-else>{{scope.column.data.name}}</span>
+                </span>
+              </span>
+              <span v-else-if="scope.column.columnname === 'accountno'">
+                <span v-if="scope.column.data.isleader == 1">
+                  <span style="margin-right: 10px">{{scope.column.data.accountno}}</span>
+                  <el-tag type="danger" size="mini">主账号</el-tag>
+                </span>
+                <span v-else>
+                  <span>{{scope.column.data.accountno}}</span>
+                </span>
+              </span>
+              <p v-else>{{scope.column.data[scope.column.columnname] || '--'}}</p>
+            </template>
+            <template v-slot:opreation="scope">
+              <el-checkbox :checked="scope.data.checkRow" @change="userCheck(scope.data)" :disabled="userLeader === scope.data.userid"></el-checkbox>
+            </template>
+          </tableLayout>
+        </el-col>
+        <el-col :span="24" class="div_top" v-if="sys_payincidence == '2'">
+          <tableLayout ref="account2" :layout="tablecolsMain" :data="list"  :opwidth="200" :custom="true"  :height="'370px'" fixedName="operation">
+            <template v-slot:customcol="scope">
+              <span v-if="scope.column.columnname === 'operation'" ></span>
+              <span v-else-if="scope.column.columnname === 'enddate'">
+                <span v-for="(item,index) in scope.column.data.enddate" :key="index">
+                  <span v-if="form.sys_site_systempartitionid == index">{{item}}</span>
+                </span>
+              </span>
+              <p v-else>{{scope.column.data[scope.column.columnname] || ''}}</p>
+            </template>
+            <template v-slot:opreation="scope">
+              <el-checkbox :checked="scope.data.checkRow" @change="userCheck(scope.data)" :disabled="userLeader === scope.data.userid"></el-checkbox>
+            </template>
+          </tableLayout>
+        </el-col>
+        <el-col :span="24" class="div_top">
+          <el-form :model="form"   ref="form" label-width="50px" label-position="right" size="mini">
+            <el-form-item label="备注:" >
+              <el-input v-model="form.remarks" placeholder="请输入备注内容"></el-input>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <span >共</span>
+        <span style="color: red">{{accountNum}}</span>
+         <span style="margin-right: 10px">个账号</span>
+        <span >总价:</span>
+        <span style="color: red;margin-right: 10px">¥{{amount}}</span>
+        <el-button type="danger" @click="onSubmit" :disabled="userids.length === 0">生成订单</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import tableLayout from '@/components/table/index2.vue'
+export default {
+  name: "add",
+  data() {
+    return {
+      dialogVisible:false,
+      dataNow:'',
+      versionList:[],
+      modulesList:[],
+      form:{
+        "sys_site_systempartitionid": '',
+        "orderno":'',
+        "sys_payorderid": '',
+        "remarks": "",
+        "userids": []
+      },
+      tablecolsAccount:[],
+      tablecolsMain:[],
+      tablecolsVersion:[],
+      list:[],
+      param:{
+        "classname": "system.payorder.payorder",
+        "method": "chooseUsers",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 999,
+          "where": {
+            "condition": ""
+          }
+        },
+      },
+      payInstructions:'',
+      sys_payincidence:'',
+      userids:[],
+      accountNum:0,
+      amount:0,
+      createNow:false,
+      sys_payswitch:'1',
+      userLeader:'',
+      version:""
+    }
+  },
+  components:{tableLayout},
+  methods:{
+    onShow(){
+      this.dialogVisible = true
+
+      /*this.queryAccount()*/
+      this.queryInstructions()
+      this.creatOrder()
+      /*this.queryVersion()*/
+    },
+    /*新建订单*/
+    async creatOrder(){
+      const res = await this.$api.requested({
+        "classname": "system.payorder.payorder",
+        "method": "createOrder",
+        "content": {},
+      })
+      this.form.sys_payorderid = res.data.sys_payorderid
+      this.form.orderno = res.data.orderno
+      this.queryVersion()
+    },
+    /*查询付费说明*/
+    async queryInstructions(){
+      const res = await this.$api.requested({
+        "classname": "webmanage.site.site",
+        "method": "querySite_Parameter",
+        "content": {},
+      })
+      this.payInstructions = res.data.sys_payinstructions
+      this.sys_payincidence = res.data.sys_payincidence
+      this.sys_payswitch = res.data.sys_payswitch
+    },
+    /*查询可选版本信息*/
+    async queryVersion(){
+      const res = await this.$api.requested({
+        "classname": "system.payorder.payorder",
+        "method": "chooseSystemPartition",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 999,
+          "where": {
+            "condition": ""
+          }
+        },
+      })
+      this.versionList = res.data.map(item=>{
+        return {
+          partitionname:item.partitionname,
+          rowindex:item.rowindex,
+          sys_site_systempartitionid:item.sys_site_systempartitionid,
+          systemapp:item.systemapp,
+          systemappids:item.systemappids,
+          checkRow:false
+        }
+      })
+      if (this.$route.query.isPay == 2){
+        this.versionList.forEach(item=>{
+          if (item.sys_site_systempartitionid == this.$route.query.id){
+            this.version = item.sys_site_systempartitionid
+            item.checkRow = true
+            this.modulesList = item.systemapp
+            this.form.sys_site_systempartitionid = item.sys_site_systempartitionid
+            this.queryAccount()
+            this.$refs.version.$refs.myTable.doLayout()
+          }
+        })
+      }else {
+        this.version = this.versionList[0].sys_site_systempartitionid
+        this.versionList[0].checkRow = true
+        this.modulesList = this.versionList[0].systemapp
+        this.form.sys_site_systempartitionid = this.versionList[0].sys_site_systempartitionid
+        this.queryAccount()
+        this.$refs.version.$refs.myTable.doLayout()
+      }
+
+    },
+    /*获取可选账号*/
+    async queryAccount(){
+      this.list = []
+      const res = await this.$api.requested(this.param)
+      this.list = res.data.map(item=>{
+        return {
+          accountno:item.accountno,
+          name:item.name,
+          agentname:item.agentname,
+          enddate:item.enddate,
+          isleader:item.isleader,
+          phonenumber:item.phonenumber,
+          rowindex:item.rowindex,
+          sa_agentsid:item.sa_agentsid,
+          userid:item.userid,
+          checkRow:false
+        }
+      })
+      let date = new Date()
+      let dateNow = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
+      this.dataNow = dateNow
+      if (this.$route.query.isPay == 2){
+
+        this.list.forEach((item,index)=>{
+          for (var i=0;i<this.$route.query.userid.length;i++){
+            if (item.userid == this.$route.query.userid[i]){
+              item.checkRow = true
+            }
+          }
+          if (item.isleader === 1){
+            if (item.enddate[this.form.sys_site_systempartitionid]){
+              if (dateNow > item.enddate[this.form.sys_site_systempartitionid]){
+                item.checkRow = true
+                this.userLeader = item.userid
+              }
+            }else {
+              item.checkRow = true
+              this.userLeader = item.userid
+            }
+          }
+
+        })
+        this.userids = []
+        this.list.forEach(item=>{
+          if (item.checkRow){
+            this.userids.push({
+              "isleader": item.isleader,
+              "userid": item.userid,
+              "sa_agentsid": item.sa_agentsid,
+              "enddate": item.enddate[this.form.sys_site_systempartitionid]
+            })
+          }
+        })
+        this.accountNum = this.userids.length
+        this.queryPrice()
+        this.$refs.account1.$refs.myTable.doLayout()
+        this.$refs.account2.$refs.myTable.doLayout()
+      }else {
+        this.list.forEach((item)=>{
+          if (item.isleader === 1){
+            if (item.enddate[this.form.sys_site_systempartitionid]){
+              if (dateNow > item.enddate[this.form.sys_site_systempartitionid]){
+                item.checkRow = true
+                this.userLeader = item.userid
+              }
+            }else {
+              item.checkRow = true
+              this.userLeader = item.userid
+            }
+          }
+        })
+        this.userids = []
+        this.list.forEach(item=>{
+          if (item.checkRow){
+            this.userids.push({
+              "isleader": item.isleader,
+              "userid": item.userid,
+              "sa_agentsid": item.sa_agentsid,
+              "enddate": item.enddate[this.form.sys_site_systempartitionid]
+            })
+          }
+        })
+        this.accountNum = this.userids.length
+        this.queryPrice()
+        this.$refs.account1.$refs.myTable.doLayout()
+        this.$refs.account2.$refs.myTable.doLayout()
+      }
+
+    },
+    /*选择版本*/
+    onCheck(val){
+      console.log(val,'选择版本')
+      this.userLeader = ''
+      this.userids = []
+      this.form.sys_site_systempartitionid = val
+      /*this.versionList.forEach(item=>{
+        if (item.sys_site_systempartitionid === val.sys_site_systempartitionid){
+          item.checkRow = true
+          this.form.sys_site_systempartitionid = item.sys_site_systempartitionid
+        }else {
+          item.checkRow = false
+        }
+        this.modulesList = val.systemapp
+      })*/
+
+     /* this.list.forEach(item=>{
+        if (item.checkRow){
+          item.checkRow = false
+        }
+      })
+      console.log(this.list)*/
+      this.queryAccount()
+    },
+    /*选择付费账号*/
+    userCheck(val){
+      this.userids = []
+      if (this.userLeader !== val.userid){
+        val.checkRow ? this.list[val.index].checkRow = false : this.list[val.index].checkRow = true
+      }
+      this.list.forEach(item=>{
+        if (item.checkRow){
+          this.userids.push({
+            "isleader": item.isleader,
+            "userid": item.userid,
+            "sa_agentsid": item.sa_agentsid,
+            "enddate": item.enddate[this.form.sys_site_systempartitionid]
+          })
+        }
+      })
+      this.accountNum = this.userids.length
+      this.queryPrice()
+    },
+    rowClick(val){
+      this.onCheck(val)
+    },
+    onSubmit(){
+      this.createNow = true
+      this.queryPrice()
+    },
+    /*获取订单价格*/
+    async queryPrice(){
+      const res = await this.$api.requested({
+        "classname": "system.payorder.payorder",
+        "method": "insertUsers",
+        "content": {
+          "sys_site_systempartitionid": this.form.sys_site_systempartitionid,
+          "sys_payorderid": this.form.sys_payorderid,
+          "remarks": this.form.remarks,
+          "users": this.userids
+        },
+      })
+      this.amount = res.data.amount
+      if (this.createNow){
+        this.dialogVisible = false
+        this.createNow = false
+        this.amount = 0
+        this.userLeader = ''
+        this.form.remarks = ''
+        this.accountNum = 0
+        this.$emit('onSuccess',this.form.sys_payorderid,this.form.orderno)
+      }
+    },
+    onClose(){
+      this.dialogVisible = false
+      this.createNow = false
+      this.userLeader = ''
+      this.form.remarks = ''
+      this.amount = 0
+      this.accountNum = 0
+    }
+  },
+  created() {
+    this.tablecolsAccount = this.tool.tabelCol(this.$route.name).accountTable.tablecols
+    this.tablecolsMain = this.tool.tabelCol(this.$route.name).mainBodyTable.tablecols
+    this.tablecolsVersion = this.tool.tabelCol(this.$route.name).versionTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+ /deep/ .el-dialog__title {
+   line-height: 24px;
+   font-size: 16px;
+   color: #303133;
+   font-weight: bold;
+ }
+ .pay_border{
+   background: #FFF9F2;
+   height: 30px;
+   vertical-align: center;
+   line-height: 30px
+ }
+ .pay_font{
+   color: #FA8C16;
+   margin-left: 10px;
+   font-size: 17px;
+   font-weight: bold;
+ }
+ .div_top{
+   margin-top: 20px;
+ }
+
+</style>

+ 1 - 6
src/SManagement/user/pay-orders/modules/detail.vue

@@ -79,7 +79,7 @@
                 <span style="color: red">
                   {{tool.formatAmount(scope.row.price,2)}}
                 </span>
-
+                <el-tag size="small" v-if="scope.row.price === 0" type="warning">优惠抵扣</el-tag>
               </template>
             </el-table-column>
             <el-table-column
@@ -200,13 +200,11 @@ export default {
           "sys_payorderid": this.$route.query.id
         },
       })
-      console.log(res,'订单详情')
       this.list = res.data
     },
     /*获取账号列表*/
     async queryAccount(){
       const res = await this.$api.requested(this.param)
-      console.log(res,'账号列表')
       this.accountList = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
@@ -227,9 +225,7 @@ export default {
       this.$refs.payment.queryAccount()
       this.$refs.payment.queryData()
       this.$refs.payment.queryCode(this.list.orderno)
-      console.log(this)
       this.payChangeFun(function(a) {
-        console.log(a)
         a.result  =  () => {
           that.$refs.payment.dialogVisible = false
 
@@ -248,7 +244,6 @@ export default {
         }
       })
       this.auth_data = res.data
-      console.log(this.auth_data)
       sessionStorage.setItem('module_info', JSON.stringify(this.auth_data))
     }
   },

+ 0 - 5
src/SManagement/user/pay-orders/modules/payment.vue

@@ -135,7 +135,6 @@ export default {
             "sys_payorderid":  id
           },
         })
-        console.log(res,'订单详情付款')
         this.list = res.data
         this.moduleList = res.data.systemapp
       }else {
@@ -146,7 +145,6 @@ export default {
             "sys_payorderid": this.$route.query.id || id
           },
         })
-        console.log(res,'订单详情付款')
         this.list = res.data
         this.moduleList = res.data.systemapp
       }
@@ -157,12 +155,10 @@ export default {
       if (this.$route.query.isPay ==2){
         this.param.content.sys_payorderid =  id
         const res = await this.$api.requested(this.param)
-        console.log(res,'账号列表付款')
         this.accountList = res.data
       }else {
         this.param.content.sys_payorderid = this.$route.query.id || id
         const res = await this.$api.requested(this.param)
-        console.log(res,'账号列表付款')
         this.accountList = res.data
       }
 
@@ -176,7 +172,6 @@ export default {
           "orderno": orderno
         },
       })
-      console.log(res,'付费二维码')
       if (res.code == 0){
         this.dialogVisible = false
         this.$notify.error({