浏览代码

修改bug

qukaidi 3 年之前
父节点
当前提交
c1fe87e292
共有 1 个文件被更改,包括 76 次插入105 次删除
  1. 76 105
      src/views/businessManagement/deliveryNotice/index.vue

+ 76 - 105
src/views/businessManagement/deliveryNotice/index.vue

@@ -1,61 +1,38 @@
 <template>
   <div>
     <basic-container v-show="isShow">
-      <avue-crud :option="option"
-                 :data="dataList"
-                 ref="crud"
-                 v-model="form"
-                 :page.sync="page"
-                 :search.sync="search"
-                 :table-loading="loading"
-                 @row-del="rowDel"
-                 @row-update="rowUpdate"
-                 :before-open="beforeOpen"
-                 :before-close="beforeClose"
-                 @row-save="rowSave"
-                 @search-change="searchChange"
-                 @search-reset="searchReset"
-                 @selection-change="selectionChange"
-                 @current-change="currentChange"
-                 @size-change="sizeChange"
-                 @refresh-change="refreshChange"
-                 @on-load="onLoad"
-                 @tree-load="treeLoad"
-                 @saveColumn="saveColumn"
-                 @resetColumn="resetColumn"
-                 @search-criteria-switch="searchCriteriaSwitch"
-                 :cell-style="cellStyle">
+      <avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" :search.sync="search"
+        :table-loading="loading" @row-del="rowDel" @row-update="rowUpdate" :before-open="beforeOpen"
+        :before-close="beforeClose" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
+        @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad" @saveColumn="saveColumn"
+        @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch" :cell-style="cellStyle">
         <template slot="menuLeft" slot-scope="{size}">
           <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制单据</el-button>
-          <el-button type="info" :size="size" icon="el-icon-printer":loading="exportLoading"
-                     @click.stop="statement">报表打印</el-button>
+          <el-button type="info" :size="size" icon="el-icon-printer" :loading="exportLoading" @click.stop="statement">
+            报表打印</el-button>
         </template>
         <template slot-scope="scope" slot="orgOrderNo">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orgOrderNo }}</span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{
+              scope.row.orgOrderNo
+          }}</span>
         </template>
         <template slot="corpIdSearch">
-          <crop-select
-            v-model="search.corpId"
-            corpType="KH"
-          ></crop-select>
+          <crop-select v-model="search.corpId" corpType="KH"></crop-select>
         </template>
         <template slot="salesCompanySearch">
-          <select-component
-            v-model="search.salesCompany"
-            :configuration="configuration"
-          ></select-component>
+          <select-component v-model="search.salesCompany" :configuration="configuration"></select-component>
         </template>
         <template slot-scope="scope" slot="corpId">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpsName }}</span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{
+              scope.row.corpsName
+          }}</span>
         </template>
         <template slot-scope="scope" slot="salesCompany">
           {{ scope.row.salesCompanyName }}
         </template>
         <template slot="storageIdSearch">
-          <warehouseSelect
-            v-model="search.storageId"
-            :configuration="configurationWarehouse"
-          ></warehouseSelect>
+          <warehouseSelect v-model="search.storageId" :configuration="configurationWarehouse"></warehouseSelect>
         </template>
         <template slot-scope="scope" slot="storageId">
           {{ scope.row.storageName }}
@@ -64,43 +41,30 @@
           {{ scope.row.createUserName }}
         </template>
         <template slot-scope="scope" slot="menu">
-<!--          <el-button-->
-<!--            type="text"-->
-<!--            icon="el-icon-edit"-->
-<!--            size="small"-->
-<!--            @click.stop="editOpen(scope.row,scope.index)"-->
-<!--          >编辑-->
-<!--          </el-button>-->
-          <el-button
-            type="text"
-            icon="el-icon-delete"
-            size="small"
+          <!--          <el-button-->
+          <!--            type="text"-->
+          <!--            icon="el-icon-edit"-->
+          <!--            size="small"-->
+          <!--            @click.stop="editOpen(scope.row,scope.index)"-->
+          <!--          >编辑-->
+          <!--          </el-button>-->
+          <el-button type="text" icon="el-icon-delete" size="small"
             :disabled="scope.row.deliveryStatus === '已发货' || scope.row.deliveryStatus === '已到货'"
-            @click.stop="rowDel(scope.row,scope.index)"
-          >删除
+            @click.stop="rowDel(scope.row, scope.index)">删除
           </el-button>
         </template>
       </avue-crud>
     </basic-container>
 
-    <detail-page
-      ref="detail"
-      @goBack="goBack"
-      :detailData="detailData"
-      v-if="!isShow"
-    ></detail-page>
-    <report-dialog
-      :switchDialog="switchDialog"
-      :searchValue="statementData"
-      reportName="国内贸易-客户确认"
-      @onClose="onClose()"
-    ></report-dialog>
+    <detail-page ref="detail" @goBack="goBack" :detailData="detailData" v-if="!isShow"></detail-page>
+    <report-dialog :switchDialog="switchDialog" :searchValue="statementData" reportName="国内贸易-客户确认"
+      @onClose="onClose()"></report-dialog>
   </div>
 </template>
 
 <script>
 import option from "./configuration/mainList.json";
-import {customerList, typeSave, deleteDetails} from "@/api/basicData/deliveryNotice"
+import { customerList, typeSave, deleteDetails } from "@/api/basicData/deliveryNotice"
 import detailPage from "./detailsPageEdit";
 import { defaultDate } from "@/util/date";
 import reportDialog from "@/components/report-dialog/main";
@@ -138,7 +102,7 @@ export default {
         pageSize: 10,
         currentPage: 1,
         total: 0,
-        pageSizes: [10,50,100,200,300]
+        pageSizes: [10, 50, 100, 200, 300]
       },
       // 非单个禁用
       single: true,
@@ -148,7 +112,7 @@ export default {
       isShow: true,
       detailData: {},
       switchDialog: false, // 报表弹窗
-      exportLoading:false,
+      exportLoading: false,
       statementData: {},
     }
   },
@@ -156,7 +120,7 @@ export default {
     // this.search.businessDate = defaultDate(1)
     this.search.createTime = defaultDate(3)
     this.option = option
-      // this.option = await this.getColumnData(this.getColumnName(20), option);
+    // this.option = await this.getColumnData(this.getColumnName(20), option);
     gainUser().then(res => {
       this.findObject(this.option.column, "createUser").dicData = res.data.data;
     })
@@ -164,7 +128,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";
@@ -217,10 +181,10 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
-    searchCriteriaSwitch(type){
-      if (type){
+    searchCriteriaSwitch(type) {
+      if (type) {
         this.option.height = this.option.height - 140
-      }else {
+      } else {
         this.option.height = this.option.height + 140
       }
       this.$refs.crud.getTableHeight()
@@ -239,7 +203,7 @@ export default {
           message: "操作成功!"
         });
         this.page.currentPage = 1;
-        this.onLoad(this.page, {parentId: 0});
+        this.onLoad(this.page, { parentId: 0 });
       });
     },
     //修改时的修改按钮点击触发
@@ -341,13 +305,13 @@ export default {
     //点击搜索按钮触发
     searchChange(params, done) {
       if (params.businessDate) {
-        params.businessStartDate = params.businessDate[0]+ " " + "00:00:00"
-        params.businessEndDate = params.businessDate[1]+ " " + "23:59:59"
+        params.businessStartDate = params.businessDate[0] + " " + "00:00:00"
+        params.businessEndDate = params.businessDate[1] + " " + "23:59:59"
       }
       if (params.createTime) {
-        params.createTimeStart = params.createTime[0]+ " " + "00:00:00"
-        params.createTimeEnd = params.createTime[1]+ " " + "23:59:59"
-        this.$delete(params,'createTime')
+        params.createStartTime = params.createTime[0] + " " + "00:00:00"
+        params.createEndTime = params.createTime[1] + " " + "23:59:59"
+        this.$delete(params, 'createTime')
       }
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
@@ -368,22 +332,30 @@ export default {
     },
     refreshChange() {
       this.page.currentPage = 1;
-      this.onLoad(this.page,this.search);
+      this.onLoad(this.page, this.search);
     },
     onLoad(page, params) {
-      if (this.search.businessDate.length > 0) {
+      if (this.search.businessDate) {
+        params = {
+          ...params,
+          businessStartDate: this.search.businessDate[0] + " " + "00:00:00",
+          businessEndDate: this.search.businessDate[1] + " " + "23:59:59",
+        }
+        this.$delete(params, 'businessDate')
+      }
+      if (this.search.createTime) {
         params = {
           ...params,
-          businessStartDate: this.search.businessDate[0]+ " " + "00:00:00",
-          businessEndDate: this.search.businessDate[1]+ " " + "23:59:59",
+          createStartDate: this.search.createTime[0] + " " + "00:00:00",
+          createEndDate: this.search.createTime[1] + " " + "23:59:59",
         }
-        this.$delete(params,'businessDate')
+        this.$delete(params, 'createTime')
       }
       let data = this.gobackSearch(params)
       let queryParams = Object.assign({}, data, {
         size: page.pageSize,
         current: page.currentPage,
-        billType:"FH"
+        billType: "FH"
       })
       this.loading = true;
       customerList(queryParams).then(res => {
@@ -397,12 +369,12 @@ export default {
     //树桩列点击展开触发
     treeLoad(tree, treeNode, resolve) {
       const parentId = tree.id;
-      customerList({parentId: parentId}).then(res => {
+      customerList({ parentId: parentId }).then(res => {
         resolve(res.data.data.records);
       });
     },
     goBack() {
-      this.detailData=this.$options.data().detailData
+      this.detailData = this.$options.data().detailData
       if (this.$route.query.form) {
         this.$router.$avueRouter.closeTag();
         this.$router.push({
@@ -416,14 +388,14 @@ export default {
     gobackSearch(params) {
       params = Object.assign({}, this.search)
       if (params.businessDate && params.businessDate != '') {
-        params.businessStartDate = params.businessDate[0]+ " " + "00:00:00"
-        params.businessEndDate = params.businessDate[1]+ " " + "23:59:59"
-        this.$delete(params,'businessDate')
+        params.businessStartDate = params.businessDate[0] + " " + "00:00:00"
+        params.businessEndDate = params.businessDate[1] + " " + "23:59:59"
+        this.$delete(params, 'businessDate')
       }
       if (params.createTime && params.createTime != '') {
-        params.createTimeStart = params.createTime[0]+ " " + "00:00:00"
-        params.createTimeEnd = params.createTime[1]+ " " + "23:59:59"
-        this.$delete(params,'createTime')
+        params.createStartTime = params.createTime[0] + " " + "00:00:00"
+        params.createEndTime = params.createTime[1] + " " + "23:59:59"
+        this.$delete(params, 'createTime')
       }
       return params
     },
@@ -463,23 +435,23 @@ export default {
       }
     },
     statement() {
-      this.statementData = {...this.search}
-      if (this.statementData.createTime && this.statementData.createTime != '')  {
-        this.statementData.createTimeStart = this.statementData.createTime[0]+ " " + "00:00:00"
-        this.statementData.createTimeEnd = this.statementData.createTime[1]+ " " + "23:59:59"
+      this.statementData = { ...this.search }
+      if (this.statementData.createTime && this.statementData.createTime != '') {
+        this.statementData.createStartTime = this.statementData.createTime[0] + " " + "00:00:00"
+        this.statementData.createEndTime = this.statementData.createTime[1] + " " + "23:59:59"
       } else {
-        this.statementData.createTimeStart = ""
-        this.statementData.createTimeEnd = ""
+        this.statementData.createStartTime = ""
+        this.statementData.createEndTime = ""
       }
-      if (this.statementData.businessDate && this.statementData.businessDate != '')  {
-        this.statementData.businessStartDate = this.statementData.businessDate[0]+ " " + "00:00:00"
-        this.statementData.businessEndDate = this.statementData.businessDate[1]+ " " + "23:59:59"
+      if (this.statementData.businessDate && this.statementData.businessDate != '') {
+        this.statementData.businessStartDate = this.statementData.businessDate[0] + " " + "00:00:00"
+        this.statementData.businessEndDate = this.statementData.businessDate[1] + " " + "23:59:59"
       } else {
         this.statementData.businessStartDate = ""
         this.statementData.businessEndDate = ""
       }
-      this.$delete(this.statementData,'createTime')
-      this.$delete(this.statementData,'businessDate')
+      this.$delete(this.statementData, 'createTime')
+      this.$delete(this.statementData, 'businessDate')
       this.switchDialog = !this.switchDialog;
     },
     onClose(val) {
@@ -490,5 +462,4 @@ export default {
 </script>
 
 <style scoped>
-
 </style>