Explorar o código

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie %!s(int64=3) %!d(string=hai) anos
pai
achega
118f76b7e8

+ 14 - 21
src/util/contrastData.js

@@ -43,33 +43,26 @@ export function contrastList2(newlist, oldlist) {
     return true
   }
   let reg = /^[A-Za-z]+$/;
-  let len = oldlist.length
-  for (var i = 0; i < len; i++) {
-    for (let olditem in oldlist[i]) {
-      for (var j = 0; j < len; j++) {
-        for (let newitem in newlist[j]) {
-          if (oldlist[i].id == newlist[j].id) {
-            if (!reg.test(oldlist[i])) {
-              delete oldlist[i].olditem
-            }
+  for (var i = 0; i < newlist.length; i++) {
+    for (var j = 0; j < oldlist.length; j++) {
+      for (let newitem in newlist[i]) {
+        for (let olditem in oldlist[j]) {
+          if (newlist[i].id == oldlist[j].id) {
             if (!reg.test(newitem)) {
-              delete newlist[j].newitem
+              delete newlist[i].newitem
+            }
+            if (!reg.test(oldlist[j])) {
+              delete oldlist[j].olditem
             }
-            if (!(newlist[i][newitem] instanceof Array)) {
-              if (oldlist[i][olditem] != newlist[j][newitem]) {
-                return true
+            if (newitem == olditem) {
+              if (!(newlist[i][newitem] instanceof Array)) {
+                if (newlist[i][newitem] != oldlist[j][olditem]) {
+                  return true
+                }
               }
             }
           }
         }
-        // if (newitem == olditem) {
-        //   if(!(newlist[i][newitem] instanceof Array)){
-        //     if (newlist[i][newitem] != oldlist[i][olditem]) {
-        //       console.log(newitem,i,newlist[i][newitem],oldlist[i][olditem])
-        //       return true
-        //     }
-        //   }
-        // }
       }
     }
   }

+ 30 - 79
src/views/dealer/stock/index.vue

@@ -1,110 +1,53 @@
 <template>
   <div>
     <basic-container v-show="show" class="page-crad">
-      <avue-crud
-        ref="crud"
-        :option="option"
-        :data="data"
-        :page.sync="page"
-        @search-change="searchChange"
-        :search.sync="search"
-        :table-loading="loading"
-        @on-load="onLoad"
-        @row-update="rowUpdate"
-        :cell-style="cellStyle"
-      >
+      <avue-crud ref="crud" :option="option" :data="data" :page.sync="page" @search-change="searchChange"
+        :search.sync="search" :table-loading="loading" @on-load="onLoad" @row-update="rowUpdate" :cell-style="cellStyle"
+        @search-criteria-switch="searchCriteriaSwitch">
         <template slot-scope="{ row }" slot="code">
-          <span
-            style="color: #409EFF;cursor: pointer"
-            @click.stop="editOpen(row, 1)"
-            >{{ row.code }}
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.code }}
           </span>
         </template>
         <template slot-scope="{ row }" slot="cname">
-          <span
-            style="color: #409EFF;cursor: pointer"
-            @click.stop="editOpen(row, 1)"
-            >{{ row.cname }}
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.cname }}
           </span>
         </template>
         <template slot-scope="scope" slot="lockingQuantity">
-          <span
-            v-if="Number(scope.row.lockingQuantity) > 0"
-            style="color: #409EFF;cursor: pointer"
-            @click.stop="viewCell(scope.row, scope.index)"
-            >{{ scope.row.lockingQuantity }}</span
-          >
+          <span v-if="Number(scope.row.lockingQuantity) > 0" style="color: #409EFF;cursor: pointer"
+            @click.stop="viewCell(scope.row, scope.index)">{{ scope.row.lockingQuantity }}</span>
           <span v-else>{{ scope.row.lockingQuantity }}</span>
         </template>
         <template slot="storageId" slot-scope="{ row }">
           <span>{{ row.stockName }}</span>
         </template>
         <template slot="storageIdSearch">
-          <warehouse-select
-            v-model="search.storageId"
-            :configuration="configurationWarehouse"
-          />
+          <warehouse-select v-model="search.storageId" :configuration="configurationWarehouse" />
         </template>
         <template slot-scope="{ row, index }" slot="menu">
-          <el-button type="text" size="small" @click="editOpen(row, 1)"
-            >查看
+          <el-button type="text" size="small" @click="editOpen(row, 1)">查看
           </el-button>
-          <el-button type="text" size="small" @click="rowCell(row, index)"
-            >{{ row.$cellEdit ? "保存" : "修改" }}
+          <el-button type="text" size="small" @click="rowCell(row, index)">{{ row.$cellEdit ? "保存" : "修改" }}
           </el-button>
-          <el-button type="text" size="small" @click="deletePrice(row, index)"
-            >删除
+          <el-button type="text" size="small" @click="deletePrice(row, index)">删除
           </el-button>
         </template>
         <template slot="menuLeft">
-          <el-button
-            type="primary"
-            size="small"
-            icon="el-icon-plus"
-            @click="excelBox = !excelBox"
-            >导入
+          <el-button type="primary" size="small" icon="el-icon-plus" @click="excelBox = !excelBox">导入
           </el-button>
-          <el-button
-            type="success"
-            icon="el-icon-download"
-            size="small"
-            @click="derivation()"
-            >下载模板
+          <el-button type="success" icon="el-icon-download" size="small" @click="derivation()">下载模板
           </el-button>
-          <el-button
-            type="info"
-            icon="el-icon-printer"
-            size="small"
-            :loading="exportLoading"
-            @click.stop="statement"
-            >报表打印
+          <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement">
+            报表打印
           </el-button>
         </template>
       </avue-crud>
-      <el-dialog
-        title="导入库存"
-        append-to-body
-        :visible.sync="excelBox"
-        width="555px"
-      >
-        <avue-form
-          :option="excelOption"
-          v-model="excelForm"
-          :upload-after="uploadAfter"
-        />
+      <el-dialog title="导入库存" append-to-body :visible.sync="excelBox" width="555px">
+        <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter" />
       </el-dialog>
     </basic-container>
-    <detail-page
-      @goBack="goBack"
-      :detailData="detailData"
-      v-if="!show"
-    ></detail-page>
-    <report-dialog
-      :switchDialog="switchDialog"
-      :searchValue="statementData"
-      :reportName="'经销商-可用库存表'"
-      @onClose="onClose()"
-    />
+    <detail-page @goBack="goBack" :detailData="detailData" v-if="!show"></detail-page>
+    <report-dialog :switchDialog="switchDialog" :searchValue="statementData" :reportName="'经销商-可用库存表'"
+      @onClose="onClose()" />
   </div>
 </template>
 <script>
@@ -186,8 +129,17 @@ export default {
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
     }
+    this.option.height = window.innerHeight - 210;
   },
   methods: {
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 138;
+      } else {
+        this.option.height = this.option.height + 138;
+      }
+      this.$refs.crud.getTableHeight();
+    },
     cellStyle() {
       return "padding:0;height:40px;";
     },
@@ -198,8 +150,7 @@ export default {
         type: "warning"
       }).then(() => {
         window.open(
-          `/api/blade-stock/stockgoods/export-template?${
-            this.website.tokenHeader
+          `/api/blade-stock/stockgoods/export-template?${this.website.tokenHeader
           }=${getToken()}`
         );
       });

+ 32 - 64
src/views/statisticAnalysis/profitLedger/index.vue

@@ -1,68 +1,35 @@
 <template>
   <div>
     <basic-container class="page-crad" v-show="show">
-      <avue-crud
-        ref="crud"
-        :option="option"
-        :data="dataList"
-        :page.sync="page"
-        :search.sync="search"
-        :cell-style="cellStyle"
-        @search-change="searchChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @refresh-change="refreshChange"
-        @on-load="onLoad"
-        :table-loading="loading"
-        @saveColumn="saveColumn"
-        @resetColumn="resetColumn"
-        @search-criteria-switch="searchCriteriaSwitch"
-        @search-reset="searchReset"
-      >
+      <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
+        :cell-style="cellStyle" @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
+        @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch" @search-reset="searchReset">
         <template slot="menuLeft">
-          <el-button
-            type="info"
-            icon="el-icon-printer"
-            size="small"
-            :loading="exportLoading"
-            @click.stop="statement"
-            v-if="false"
-          >报表打印
+          <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement"
+            v-if="false">报表打印
           </el-button>
           <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
         </template>
         <template slot="corpNameSearch">
-          <crop-select
-            v-model="search.corpId"
-            corpType="KG"
-          ></crop-select>
+          <crop-select v-model="search.corpId" corpType="KG"></crop-select>
         </template>
         <template slot="sizeSearch">
-          <el-select
-            v-model="search.size"
-            placeholder="请选择"
-          >
+          <el-select v-model="search.size" placeholder="请选择">
             <el-option label="是" :value="1"></el-option>
             <el-option label="否" :value="0"></el-option>
           </el-select>
         </template>
         <template slot="corpName" slot-scope="scope">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpName }}</span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{
+              scope.row.corpName
+          }}</span>
         </template>
       </avue-crud>
     </basic-container>
-    <report-dialog
-      :switchDialog="switchDialog"
-      :searchValue="statementData"
-      :reportName="'经销商-可用库存表'"
-      @onClose="onClose()"
-    />
-    <detail
-      v-if="!show"
-      :detail-data="detailData"
-      :trade-type="tradeType"
-      @goBack="goBack"
-    ></detail>
+    <report-dialog :switchDialog="switchDialog" :searchValue="statementData" :reportName="'经销商-可用库存表'"
+      @onClose="onClose()" />
+    <detail v-if="!show" :detail-data="detailData" :trade-type="tradeType" @goBack="goBack"></detail>
   </div>
 </template>
 
@@ -83,8 +50,8 @@ export default {
   },
   data() {
     return {
-      exportLoading:false,
-      switchDialog:false,
+      exportLoading: false,
+      switchDialog: false,
       statementData: {},
       form: {},
       search: {},
@@ -139,9 +106,9 @@ export default {
             label: "年月",
             prop: "accDate",
             search: true,
-            type: 'date',
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd",
+            type: 'month',
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
             unlinkPanels: true,
             searchRange: true,
             overHidden: true,
@@ -199,7 +166,7 @@ export default {
     this.option.column.forEach(item => {
       if (item.search) i++
     })
-    if (i % 3 !== 0){
+    if (i % 3 !== 0) {
       const num = 3 - Number(i % 3)
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
@@ -258,12 +225,12 @@ export default {
       this.dataList.forEach(item => {
         this.$refs.crud.toggleRowExpansion(item, false);
       });
-      let queryParams = Object.assign({tradeType: this.tradeType}, params);
+      let queryParams = Object.assign({ tradeType: this.tradeType }, params);
       if (queryParams.accDate && queryParams.accDate.length > 0) {
         queryParams = {
           ...queryParams,
-          accDateStart: queryParams.accDate[0] + ' 00:00:00',
-          accDateEnd: queryParams.accDate[1] + ' 23:59:59',
+          accDateStart: queryParams.accDate[0],
+          accDateEnd: queryParams.accDate[1],
         }
         delete queryParams.accDate;
       }
@@ -306,10 +273,10 @@ export default {
       }
     },
     statement() {
-      this.statementData = {...this.search};
+      this.statementData = { ...this.search };
       if (this.statementData.accDate && this.statementData.accDate.length > 0) {
-        this.statementData.accDateStart = this.statementData.accDate[0]+ " " + "00:00:00"
-        this.statementData.accDateEnd = this.statementData.accDate[1]+ " " + "23:59:59"
+        this.statementData.accDateStart = this.statementData.accDate[0]
+        this.statementData.accDateEnd = this.statementData.accDate[1]
         delete this.statementData.accDate
       }
       this.switchDialog = !this.switchDialog;
@@ -352,7 +319,7 @@ export default {
       this.show = false;
     },
     goBack() {
-      this.detailData=this.$options.data().detailData
+      this.detailData = this.$options.data().detailData
       if (JSON.stringify(this.$route.query) != "{}") {
         this.$router.$avueRouter.closeTag();
         this.$router.push({
@@ -370,8 +337,8 @@ export default {
       if (this.search.accDate && this.search.accDate.length > 0) {
         this.search = {
           ...this.search,
-          accDateStart: this.search.accDate[0] + ' 00:00:00',
-          accDateEnd: this.search.accDate[1] + ' 23:59:59',
+          accDateStart: this.search.accDate[0],
+          accDateEnd: this.search.accDate[1]
         }
       } else {
         this.search = {
@@ -386,8 +353,7 @@ export default {
         type: 'warning'
       }).then(() => {
         window.open(
-          `/api/trade-finance/profit/export?${
-            this.website.tokenHeader
+          `/api/trade-finance/profit/export?${this.website.tokenHeader
           }=${getToken()}&tradeType=${this.tradeType}&corpId=${this.search.corpId}&accDateStart=${this.search.accDateStart}&accDateEnd=${this.search.accDateEnd}`
         );
       }).catch(() => {
@@ -405,9 +371,11 @@ export default {
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }
+
 ::v-deep .el-table__expanded-cell[class*="cell"] {
   padding: 0px;
 }
+
 .itemTable ::v-deep .el-table {
   width: 100%;
 }

+ 6 - 6
src/views/workManagement/main-items/detailsPage.vue

@@ -434,7 +434,7 @@
   //事务
   import examineApprove from "@/components/examineApprove/index";
   //对象数组比较
-  import { contrastObj,contrastList } from "@/util/contrastData";
+  import { contrastObj,contrastList2 } from "@/util/contrastData";
   import _ from "lodash";
   import { getUserList } from "@/api/workManagement/mainProject";
   import optionAdd from "../receipt/configuration/settleAccountsDetailsADD.json";
@@ -1232,8 +1232,8 @@
       },
       verificationData(){
         this.detailsCollection()
-        if(contrastObj(this.form,this.oldForm)||contrastObj(this.formTwo,this.oldFormTwo) || contrastList(this.dataList,this.oldData)
-          || contrastList(this.upLoadData,this.oldUpLoadData)
+        if(contrastObj(this.form,this.oldForm)||contrastObj(this.formTwo,this.oldFormTwo) || contrastList2(this.dataList,this.oldData)
+          || contrastList2(this.upLoadData,this.oldUpLoadData)
         ) {
           this.$confirm("数据发生变化,请先提交保存!", "提示", {
             confirmButtonText: "保存",
@@ -1402,8 +1402,8 @@
       //返回主营项目列表
       backToList(){
         this.detailsCollection()
-        if(contrastObj(this.form,this.oldForm) || contrastObj(this.formTwo,this.oldFormTwo) || contrastList(this.dataList,this.oldData)
-          || contrastList(this.upLoadData,this.oldUpLoadData)
+        if(contrastObj(this.form,this.oldForm) || contrastObj(this.formTwo,this.oldFormTwo) || contrastList2(this.dataList,this.oldData)
+          || contrastList2(this.upLoadData,this.oldUpLoadData)
         ){
           this.$confirm("当前页面有未保存数据,是否保存数据?", "提示", {
             confirmButtonText: "保存",
@@ -1485,7 +1485,7 @@
       //     })
       //     if(id.findIndex(item => item != true) == -1){
       //       if(result.findIndex(item => item != true) == -1){
-      //         if(contrastObj(this.form,this.oldForm) || contrastList(this.data,this.oldData)){  //判断是否改动过此页面
+      //         if(contrastObj(this.form,this.oldForm) || contrastList2(this.data,this.oldData)){  //判断是否改动过此页面
       //           this.$confirm("您已改动此页面,请先保存之后在请核?", "提示", {
       //             confirmButtonText: "保存",
       //             cancelButtonText: "取消",