qinbai %!s(int64=3) %!d(string=hai) anos
pai
achega
d6afd78a99

+ 187 - 0
src/views/statisticAnalysis/royalty/index.vue

@@ -0,0 +1,187 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :page.sync="page"
+               :search.sync="search"
+               :table-loading="loading"
+               :span-method="spanMethod"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @saveColumn="saveColumn"
+               @resetColumn="resetColumn"
+               @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button size="small"
+                   type="info"
+                   icon="el-icon-download"
+                   :loading="exportLoading"
+                   @click.stop="downFile"
+        >报表
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import option from "./config/mainList.json";
+  import { getProfitList } from "@/api/statisticAnalysis/profit";
+  import { contrastList } from "@/util/contrastData";
+
+  export default {
+    data() {
+      return {
+        loading : false,
+        exportLoading:false,
+        form: {},
+        search:{},
+        show:true,
+        detailData:{},
+        option: option,
+        spanArr:[],
+        position:0,
+        parentId:0,
+        dataList: [],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        query:{},
+        configuration:{
+          multipleChoices:false,
+          multiple:false,
+          disabled:false,
+          searchShow:true,
+          collapseTags:false,
+          clearable:true,
+          placeholder:'请点击右边按钮选择',
+          dicData:[]
+        },
+      }
+    },
+    async created() {
+      // this.option = await this.getColumnData(this.getColumnName(66), option);
+    },
+    mounted() {
+
+    },
+    methods: {
+      addReceipt(){
+        console.log('1')
+      },
+      editOpen(){
+        console.log('1')
+      },
+      rowspan() {
+        //记录原始
+        let oldList = [this.dataList[0].name]
+        this.dataList.forEach((item,index)=>{
+          let newList = [item.name]
+          if(index===0){
+            this.spanArr.push(1)
+            this.position=0;
+          }else{
+            //如果循环数据与原始数据相等  那么合并
+            if(!contrastList(oldList,newList)){
+              this.spanArr[this.position] +=1;
+              this.spanArr.push(0)
+            }else{
+              //如果不等 更新原始数据  循环在比较
+              oldList = newList
+              this.spanArr.push(1)
+              this.position = index
+            }
+          }
+        })
+      },
+      spanMethod({ row, column, rowIndex, columnIndex }) {
+        if (column.property === "name") {
+          const _row=this.spanArr[rowIndex];
+          const _col=_row>0?1:0;
+          return {
+            rowspan:_row,
+            colspan:_col
+          }
+        }
+      },
+      //点击搜索按钮触发
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done()
+      },
+      searchReset() {
+        console.log('1')
+      },
+      selectionChange() {
+        console.log('1')
+      },
+      currentChange(val) {
+        this.page.currentPage = val
+      },
+      sizeChange() {
+        console.log('1')
+      },
+      refreshChange() {
+        this.onLoad(this.page);
+      },
+      paramsAdjustment(params) {
+        params = Object.assign({}, this.search);
+        if (params.createTime &&  params.createTime.length !==0 ) {  //发货
+          params.startTime = params.createTime[0]+ " " + "00:00:00";
+          params.endTime = params.createTime[1] + " " + "23:59:59";
+          this.$delete(params,'createTime')
+        }
+        return params
+      },
+      onLoad(page, params) {
+        // this.loading = true;
+        // params = this.paramsAdjustment(params)
+        // getProfitList(page.currentPage, page.pageSize,params).then(res=>{
+        //   this.dataList = res.data.data.records
+        //   this.page.total = res.data.data.total
+        //   this.rowspan()
+        // }).finally(()=>{
+        //   this.loading = false;
+        // })
+      },
+      //列保存触发
+      async saveColumn() {
+        const inSave = await this.saveColumnData(
+          this.getColumnName(66),
+          this.option
+        );
+        if (inSave) {
+          this.$message.success("保存成功");
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      async resetColumn() {
+        const inSave = await this.delColumnData(
+          this.getColumnName(66),
+          option
+        );
+        if (inSave) {
+          this.$message.success("重置成功");
+          this.option = option;
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 291 - 0
src/views/system/application/detailsPage.vue

@@ -0,0 +1,291 @@
+<template>
+  <div class="borderless">
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList">返回列表
+        </el-button>
+        <div class="upper_right_button">
+          <el-button class="el-button--small-yh"
+                     type="primary"
+                     size="small"
+                     :loading="buttonLoading"
+                     @click.stop="saveData"
+          >保存数据
+          </el-button>
+        </div>
+      </div>
+    </div>
+    <div class="customer-main">
+      <containerTitle title="基础信息"></containerTitle>
+      <basic-container>
+        <avue-form class="trading-form" ref="form" v-model="form" :option="option">
+          <template slot="remark">
+            <el-input type="textarea"
+                      v-model="form.remark"
+                      size="small"
+                      rows="2"
+                      autocomplete="off"
+                      placeholder="">
+            </el-input>
+          </template>
+        </avue-form>
+      </basic-container>
+      <containerTitle title="明细列表"></containerTitle>
+      <basic-container>
+        <avue-crud :option="itemsOption"
+                   :data="dataList"
+                   ref="crud"
+                   v-model="itemsForm"
+                   @search-reset="searchReset"
+                   @row-update="rowUpdate"
+                   @selection-change="selectionChange"
+                   @current-change="currentChange"
+                   @size-change="sizeChange"
+                   @refresh-change="refreshChange">
+          <template slot="menuLeft">
+            <el-button type="primary"
+                       size="small"
+                       :loading="buttonLoading"
+                       @click="addDetail"
+            >录入明细
+            </el-button>
+          </template>
+          <template slot-scope="scope" slot="menu">
+            <el-button
+              type="text"
+              size="small"
+              icon="el-icon-edit"
+              @click.stop="rowCell(scope.row,scope.index)"
+            > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
+            </el-button>
+            <el-button
+              type="text"
+              size="small"
+              icon="el-icon-delete"
+              @click.stop="rowDel(scope.row,scope.index)"
+            >删除
+            </el-button>
+          </template>
+        </avue-crud>
+      </basic-container>
+    </div>
+  </div>
+</template>
+
+<script>
+  import option from "./config/detailsPage.json";
+  import { contrastObj,contrastList } from "@/util/contrastData";
+  import {appSave  ,appDetail,appDetailRemove} from "@/api/application/application";
+
+  export default {
+    name: "receiptDetailsPage",
+    props: {
+      detailData: {
+        type: Object
+      }
+    },
+    components:{
+
+    },
+    data() {
+      return {
+        buttonLoading:false,
+        form: {},
+        itemsForm:{},
+        dataList: [],
+        itemsOption: option,
+        option: {
+          menuBtn: false,
+          labelWidth: 100,
+          column: [
+            {
+              label: 'app名称',
+              prop: 'appName',
+              span: 8,
+              rules: [
+                {
+                  required: true,
+                  message: ' ',
+                  trigger: 'blur'
+                }
+              ]
+            },{
+              label: '应用描述',
+              prop: 'appDesc',
+              span: 8,
+            },
+            {
+              label: '类型',
+              prop: 'type',
+              type:'select',
+              dicData:[{
+                label:'安卓',
+                value:0,
+              },
+                {
+                  label:'苹果',
+                  value:1,
+                }],
+              span: 8,
+            },
+            {
+              label: '苹果appStoreId',
+              prop: 'appStoreId',
+              span: 8,
+            },
+            {
+              label: '苹果bundleId',
+              prop: 'bundleId',
+              span: 8,
+            },
+            {
+              label: '安卓包名',
+              prop: 'packageName',
+              span: 8,
+            },
+          ],
+        },
+        oldForm:{},
+        oldDataList:[],
+      }
+    },
+    created() {
+      if(this.detailData.id){
+        this.buttonLoading = true
+        appDetail(this.detailData.id).then(res=>{
+          this.afterEcho(res.data.data)
+        }).finally(()=>{
+          this.buttonLoading = false
+        })
+      }
+    },
+    mounted() {
+
+    },
+    methods: {
+      rowUpdate(row, index, done) {
+        done(row);
+      },
+      rowCell(row,index){
+        this.$refs.crud.rowCell(row, index)
+      },
+      rowDel(row,index){
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          if(row.id){
+            appDetailRemove(row.id).then(res=>{
+              if(res.data.success){
+                this.$message.success("操作成功!")
+                this.dataList.splice(index, 1);
+              }
+            })
+          }else{
+            this.dataList.splice(index, 1);
+          }
+        })
+      },
+      addDetail(){
+        this.$refs.crud.rowCellAdd();
+      },
+      searchReset() {
+        console.log('1')
+      },
+      selectionChange() {
+        console.log('1')
+      },
+      currentChange() {
+        console.log('1')
+      },
+      sizeChange() {
+        console.log('1')
+      },
+      refreshChange() {
+        console.log('1')
+      },
+      saveData(type){
+        this.buttonLoading = true
+        let params = {
+          ...this.form,
+          appVersionList: this.dataList
+        }
+        appSave(params).then(res =>{
+          if(res.data.success){
+            this.$message.success("操作成功!")
+            this.afterEcho(res.data.data)
+          }
+        }).finally(()=>{
+          this.buttonLoading = false
+          if(type === true){
+            this.$emit("goBack");
+          }
+        })
+      },
+      afterEcho(data){
+        this.form = data
+        this.oldForm = Object.assign({},data);
+
+        if(data.appVersionList){
+          this.dataList = data.appVersionList
+          this.oldDataList = this.deepClone(data.appVersionList)
+        }
+      },
+      verificationData(){
+        if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
+        ){
+          this.$confirm("数据发生变化,请先提交保存!", "提示", {
+            confirmButtonText: "保存",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.saveData()
+          }).catch(()=>{
+            return false
+          })
+        }else{
+          return true
+        }
+      },
+      backToList(){
+        if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
+        ){
+          this.$confirm("是否保存当前页面?", "提示", {
+            confirmButtonText: "保存",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.saveData(true)
+          }).catch(()=>{
+            this.$emit("goBack");
+          })
+        }else{
+          this.$emit("goBack");
+        }
+      },
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+.trading-form ::v-deep .el-form-item {
+  margin-bottom: 8px !important;
+}
+.required_fields{
+  color: #F56C6C;
+  display:inline-block;
+  width: 7%
+}
+.upper_right_button{
+  display: flex;
+  position: fixed;
+  right: 12px;
+  top: 47px;
+}
+</style>