Browse Source

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

QuKatie 3 years ago
parent
commit
7dbab48123

+ 8 - 0
src/api/approval/processConfig.js

@@ -58,6 +58,14 @@ export function getUserList(params) {
   })
 }
 
+//审批获得审批人
+export function getUserApprovalList(params) {
+  return request({
+    url: '/api/blade-user/userList',
+    method: 'get',
+  })
+}
+
 // 更改审批人
 export function changeApprove(url, data) {
   return request({

+ 28 - 0
src/enums/column-name.js

@@ -259,6 +259,34 @@ const columnName = [{
     code: 76,
     name: '出口合同附件'
   },
+  {
+    code: 77,
+    name: '内贸合同附件'
+  },
+  {
+    code: 78,
+    name: '销售订单(D)列表'
+  },
+  {
+    code: 79,
+    name: '销售订单(D)商品明细'
+  },
+  {
+    code: 80,
+    name: '销售订单(D)商品导入'
+  },
+  {
+    code: 81,
+    name: '采购订单(D)列表'
+  },
+  {
+    code: 82,
+    name: '采购订单(D)商品明细'
+  },
+  {
+    code: 83,
+    name: '采购订单(D)商品导入'
+  },
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

+ 26 - 0
src/router/views/index.js

@@ -1071,4 +1071,30 @@ export default [{
       component: () => import( /* webpackChunkName: "views" */ '@/views/system/businessLock/index')
     }]
   },
+  {
+    path: '/dealer/sales/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/dealer/sales/index',
+      name: '销售订单(D)',
+      meta: {
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/dealer/sales/index')
+    }]
+  },
+  {
+    path: '/dealer/purchase/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/dealer/purchase/index',
+      name: '采购订单(D)',
+      meta: {
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/dealer/purchase/index')
+    }]
+  },
 ]

+ 3 - 0
src/styles/variables.scss

@@ -80,3 +80,6 @@ p{
   display: flex;
   justify-content: flex-end;
 }
+.el-table__expanded-cell {
+  padding-left: 90px !important;
+}

+ 3 - 3
src/views/approval/processConfig/index.vue

@@ -171,7 +171,7 @@
 <script>
 import option from "./config/mainList.json";
 import detailOption from "./config/detail.json";
-import { getList, modify, removeList, detailData ,getUserList} from "@/api/approval/processConfig";
+import { getList, modify, removeList, detailData ,getUserList,getUserApprovalList} from "@/api/approval/processConfig";
 import _ from "lodash";
 
 export default {
@@ -214,8 +214,8 @@ export default {
     this.option = option
     this.detailOption = detailOption
 
-    getUserList().then(res =>{
-      this.auditUserIdDic = res.data.data.records
+    getUserApprovalList().then(res =>{
+      this.auditUserIdDic = res.data.data
     })
 
     let i = 0;

+ 7 - 6
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -243,6 +243,7 @@
         <c-upload
           :data="bankOfDepositData"
           deleteUrl="/api/blade-deliver-goods/deliveryfiles/update"
+          :enumerationValue="77"
         />
       </el-form>
     </div>
@@ -1180,11 +1181,11 @@ export default {
     },
     //商品编辑
     rowCell(row, index) {
-      this.$refs.crudContact.rowCell(row, index)
+      this.$refs.crudContact.rowCell(row, row.$index)
     },
     //费用编辑
     rowCellTwo(row, index) {
-      this.$refs.crudProject.rowCell(row, index)
+      this.$refs.crudProject.rowCell(row, row.$index)
     },
     //费用新增触发
     costIncrease() {
@@ -1366,7 +1367,7 @@ export default {
               type: "success",
               message: "操作成功!"
             });
-            this.goodsShowData.splice(index, 1);
+            this.goodsShowData.splice(row.$index, 1);
             // 删除时主表积分跟着改变
             if (this.goodsActives == 'goods') {
               this.form.presenterIntegral = 0;
@@ -1385,7 +1386,7 @@ export default {
             type: "success",
             message: "操作成功!"
           });
-          this.goodsShowData.splice(index, 1);
+          this.goodsShowData.splice(row.$index, 1);
           // 删除时主表积分跟着改变
           if (this.goodsActives == 'goods') {
             this.form.presenterIntegral = 0;
@@ -1461,14 +1462,14 @@ export default {
               type: "success",
               message: "操作成功!"
             });
-            this.advantageProjectData.splice(index, 1);
+            this.advantageProjectData.splice(row.$index, 1);
           })
         } else {
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.advantageProjectData.splice(index, 1);
+          this.advantageProjectData.splice(row.$index, 1);
         }
       })
     },

+ 8 - 7
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -247,6 +247,7 @@
         <c-upload
           :data="bankOfDepositData"
           deleteUrl="/api/trade-purchase/purchase-order/removeByFiles"
+          :enumerationValue="77"
         />
       </el-form>
     </div>
@@ -1060,11 +1061,11 @@ export default {
           return this.$message.error('订货数量不能小于发货数量')
         }
       }
-      this.$refs.crudContact.rowCell(row, index)
+      this.$refs.crudContact.rowCell(row, row.$index)
     },
     //费用编辑
     rowCellTwo(row, index) {
-      this.$refs.crudProject.rowCell(row, index)
+      this.$refs.crudProject.rowCell(row, row.$index)
     },
     //商品选中触发
     productSelection(selection) {
@@ -1281,14 +1282,14 @@ export default {
               type: "success",
               message: "操作成功!"
             });
-            this.contactsData.splice(index, 1);
+            this.contactsData.splice(row.$index, 1);
           })
         } else {
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.contactsData.splice(index, 1);
+          this.contactsData.splice(row.$index, 1);
         }
       })
     },
@@ -1353,14 +1354,14 @@ export default {
               type: "success",
               message: "操作成功!"
             });
-            this.advantageProjectData.splice(index, 1);
+            this.advantageProjectData.splice(row.$index, 1);
           })
         } else {
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.advantageProjectData.splice(index, 1);
+          this.advantageProjectData.splice(row.$index, 1);
         }
       })
     },
@@ -1648,7 +1649,7 @@ export default {
       }
     },
     removeStagList(row, index) {
-      this.goodsListSave.splice(index, 1)
+      this.goodsListSave.splice(row.$index, 1)
     },
     importStagList(row, index) {
       this.goodsListSave.push(row);

+ 7 - 8
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -199,6 +199,7 @@
         <c-upload
           :data="bankOfDepositData"
           deleteUrl="/api/blade-deliver-goods/deliveryfiles/update"
+          :enumerationValue="77"
         />
       </el-form>
     </div>
@@ -879,13 +880,11 @@ export default {
     },
     //商品编辑
     rowCell(row, index) {
-      console.log(row)
-      this.$refs.crudContact.rowCell(row, index)
+      this.$refs.crudContact.rowCell(row, row.$index)
     },
     //费用编辑
     rowCellTwo(row, index) {
-      console.log(row)
-      this.$refs.crudProject.rowCell(row, index)
+      this.$refs.crudProject.rowCell(row, row.$index)
     },
     //费用新增触发
     costIncrease() {
@@ -1068,14 +1067,14 @@ export default {
               type: "success",
               message: "操作成功!"
             });
-            this.contactsData.splice(index, 1);
+            this.contactsData.splice(row.$index, 1);
           })
         } else {
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.contactsData.splice(index, 1);
+          this.contactsData.splice(row.$index, 1);
         }
       })
     },
@@ -1141,14 +1140,14 @@ export default {
               type: "success",
               message: "操作成功!"
             });
-            this.advantageProjectData.splice(index, 1);
+            this.advantageProjectData.splice(row.$index, 1);
           })
         } else {
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.advantageProjectData.splice(index, 1);
+          this.advantageProjectData.splice(row.$index, 1);
         }
       })
     },

+ 8 - 8
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -440,6 +440,7 @@
         <c-upload
           :data="bankOfDepositData"
           deleteUrl="/api/blade-client/corpsbank/update"
+          :enumerationValue="77"
         />
 
       </el-form>
@@ -1564,7 +1565,6 @@ export default {
     this.rowHeight = (window.innerHeight - 130) + 'px'
     // this.customerContact = customerContact
     this.customerContact = await this.getColumnData(this.getColumnName(15), customerContact);
-    this.advantageProject = await this.getColumnData(this.getColumnName(16), advantageProject);
     this.getWorkDicts("payment_term").then(res => {
       this.paymentOption = res.data.data
     })
@@ -1848,11 +1848,11 @@ export default {
           return this.$message.error('订货数量不能小于发货数量')
         }
       }
-      this.$refs.crudContact.rowCell(row, index)
+      this.$refs.crudContact.rowCell(row, row.$index)
     },
     //费用编辑
     rowCellTwo(row, index) {
-      this.$refs.crudProject.rowCell(row, index)
+      this.$refs.crudProject.rowCell(row, row.$index)
     },
     //费用新增触发
     costIncrease() {
@@ -2641,7 +2641,7 @@ export default {
               type: "success",
               message: "操作成功!"
             });
-            this.goodsShowData.splice(index, 1);
+            this.goodsShowData.splice(row.$index, 1);
             if (this.goodsActives == 'goods') {
               this.form.presenterIntegral = 0;
               this.form.orderAmount = 0;
@@ -2662,7 +2662,7 @@ export default {
             type: "success",
             message: "操作成功!"
           });
-          this.goodsShowData.splice(index, 1);
+          this.goodsShowData.splice(row.$index, 1);
           if (this.goodsActives == 'goods') {
             this.form.presenterIntegral = 0;
             this.form.orderAmount = 0;
@@ -2762,14 +2762,14 @@ export default {
               type: "success",
               message: "操作成功!"
             });
-            this.advantageProjectData.splice(index, 1);
+            this.advantageProjectData.splice(row.$index, 1);
           })
         } else {
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.advantageProjectData.splice(index, 1);
+          this.advantageProjectData.splice(row.$index, 1);
         }
       })
     },
@@ -3142,7 +3142,7 @@ export default {
       }
     },
     removeStagList(row, index) {
-      this.goodsListSave.splice(index, 1)
+      this.goodsListSave.splice(row.$index, 1)
     },
     importStagList(row, index) {
       this.goodsListSave.push(row);

+ 4 - 1
src/views/businessManagement/salesOrder/index.vue

@@ -531,7 +531,7 @@ export default {
       }).catch(() => {
         this.$message({
           type: 'info',
-          message: '已取消'
+          message: '已取消' //
         });
       })
     },
@@ -546,4 +546,7 @@ export default {
 /deep/ .el-table__body-wrapper .cell {
   font-size: 8px;
 }
+/*/deep/ .el-table__expanded-cell {*/
+/*  padding-left: 90px;*/
+/*}*/
 </style>

+ 80 - 0
src/views/dealer/purchase/config/commodity.json

@@ -0,0 +1,80 @@
+{
+  "stripe": true,
+  "border": true,
+  "searchMenuSpan": 16,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "menu": false,
+  "align": "center",
+  "menuWidth": "180",
+  "selection": true,
+  "tip": false,
+  "column": [{
+    "label": "商品编号",
+    "prop": "code",
+    "index": 1,
+    "width": 100,
+    "search": true,
+    "searchSpan": 8,
+    "overHidden": true
+  },
+    {
+      "label": "商品名称",
+      "search": true,
+      "searchSpan": 8,
+      "prop": "cname",
+      "index": 2,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "商品类别",
+      "prop": "goodsTypeName",
+      "index": 3,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "规格尺寸",
+      "prop": "typeno",
+      "index": 4,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "花纹",
+      "prop": "brandItem",
+      "index": 5,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "负荷指数",
+      "prop": "specsOne",
+      "index": 6,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "速级",
+      "prop": "specsTwo",
+      "index": 7,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "加强型",
+      "prop": "level",
+      "index": 8,
+      "width": 120,
+      "overHidden": true
+    }
+  ]
+}

+ 100 - 0
src/views/dealer/purchase/config/customerContact.json

@@ -0,0 +1,100 @@
+{
+  "searchShow": true,
+  "stripe": true,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "addBtn": false,
+  "delBtn": false,
+  "align": "center",
+  "menuWidth": 120,
+  "refreshBtn": false,
+  "showSummary": true,
+  "column": [
+    {
+      "label": "产品编码",
+      "prop": "code",
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "商品名称",
+      "prop": "cname",
+      "index": 2,
+      "width": 200,
+      "overHidden": true
+    },
+    {
+      "label": "规格",
+      "prop": "typeno",
+      "index": 3,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "花纹",
+      "prop": "brandItem",
+      "index": 4,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "负荷指数",
+      "prop": "specsOne",
+      "index": 5,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "速度级别",
+      "prop": "specsTwo",
+      "index": 6,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "单位",
+      "prop": "a",
+      "index": 7,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "库存",
+      "prop": "storageQuantity",
+      "index": 8,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "数量",
+      "prop": "actualQuantity",
+      "index": 9,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "尺寸",
+      "prop": "size",
+      "index": 10,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "价格",
+      "prop": "price",
+      "index": 11,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "小计",
+      "prop": "amount",
+      "index": 12,
+      "width": 100,
+      "overHidden": true
+    }
+  ]
+}

+ 75 - 0
src/views/dealer/purchase/config/mainList.json

@@ -0,0 +1,75 @@
+{
+  "stripe": true,
+  "height": "auto",
+  "searchShow": true,
+  "searchMenuSpan": 24,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "align": "center",
+  "menuWidth": "70",
+  "showSummary": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "selection": true,
+  "tip": false,
+  "searchSpan": 8,
+  "column": [
+    {
+      "label": "采购订单号",
+      "prop": "orderNo",
+      "search": true,
+      "index": 1,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "系统编号",
+      "prop": "sysNo",
+      "search": true,
+      "index": 2,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "客户名称",
+      "prop": "corpId",
+      "search": true,
+      "index": 3,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "业务时间",
+      "prop": "businesDate",
+      "search": true,
+      "index": 4,
+      "minWidth": 80,
+      "overHidden": true,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true
+    },
+    {
+      "label": "电话",
+      "prop": "tel",
+      "search": false,
+      "index": 5,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "地址",
+      "prop": "attn",
+      "search": false,
+      "index": 6,
+      "minWidth": 80,
+      "overHidden": true
+    }
+  ]
+}

+ 547 - 0
src/views/dealer/purchase/detail.vue

@@ -0,0 +1,547 @@
+<template>
+  <div class="borderless" v-loading="pageLoading">
+    <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>
+      <div class="add-customer-btn">
+        <el-button
+          type="primary"
+          size="small"
+          class="el-button--small-yh"
+          @click.stop="openEdit"
+        >编 辑</el-button>
+        <el-button
+          type="success"
+          :disabled="!form.id"
+          size="small"
+          @click="copyDoc"
+        >
+          复制单据
+        </el-button>
+        <el-button
+          type="primary"
+          @click="editCustomer"
+          size="small"
+        >保存数据
+        </el-button>
+      </div>
+    </div>
+    <div class="customer-main">
+      <containerTitle title="基础信息"/>
+      <basic-container :showBtn="true">
+        <avue-form
+          ref="form"
+          class="trading-form"
+          v-model="form"
+          :option="option"
+        >
+          <template slot="corpId">
+            <crop-select
+              v-model="form.corpId"
+              @getCorpData="getCorpData"
+              corpType="GYS"
+            ></crop-select>
+          </template>
+        </avue-form>
+      </basic-container>
+      <containerTitle title="商品信息"/>
+      <basic-container>
+        <avue-crud
+          ref="crud"
+          :data="dataList"
+          :option="tableOption"
+          :cell-style="cellStyle"
+          @saveColumn="saveColumn"
+          @resetColumn="resetColumn"
+        >
+          <template slot="menuLeft">
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              size="small"
+              @click.stop="newDetails"
+            >录入明细</el-button>
+            <el-button
+              type="info"
+              icon="el-icon-printer"
+              size="small"
+              @click.stop="openReport()"
+            >报 表</el-button
+            >
+          </template>
+          <template slot="menu" slot-scope="{ row, index }">
+            <el-button
+              size="small"
+              icon="el-icon-edit"
+              type="text"
+              @click="rowCell(row, index)"
+            >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
+            >
+            <el-button
+              size="small"
+              icon="el-icon-delete"
+              type="text"
+              @click="rowDel(row, index)"
+            >删除</el-button
+            >
+          </template>
+          <template slot="cname" slot-scope="{ row, index }">
+            <span v-if="row.$cellEdit" style="display:flex">
+              <el-select
+                v-model="row.itemId"
+                placeholder="请选择"
+                size="small"
+                style="width:60%"
+                @change="cnameChange(row, index)"
+              >
+                <el-option
+                  v-for="item in goodsoptions"
+                  :key="item.id"
+                  :label="item.cname"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <el-button
+                icon="el-icon-search"
+                size="small"
+                @click="rePick(row, index)"
+              ></el-button>
+            </span>
+
+            <span v-else> {{ row.cname }}</span>
+          </template>
+          <template slot="actualQuantity" slot-scope="{ row, index }">
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.actualQuantity"
+              size="small"
+            ></el-input>
+            <span v-else>{{ row.actualQuantity }}</span>
+          </template>
+          <template slot="price" slot-scope="{ row, index }">
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.price"
+              size="small"
+            ></el-input>
+            <span v-else>{{ row.price }}</span>
+          </template>
+        </avue-crud>
+      </basic-container>
+    </div>
+    <el-dialog
+      title="导入商品"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="dialogVisible"
+      width="80%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      @close="closeGoods"
+      top="5vh"
+      v-dialog-drag
+    >
+      <span>
+        <el-row>
+          <el-col :span="4">
+            <div>
+              <el-scrollbar>
+                <basic-container>
+                  <avue-tree
+                    :option="treeOption"
+                    @node-click="nodeClick"
+                    :style="treeStyle"
+                  />
+                </basic-container>
+              </el-scrollbar>
+            </div>
+          </el-col>
+          <el-col :span="20">
+            <avue-crud
+              :option="goodsOption"
+              :table-loading="loading"
+              :data="goodsList"
+              ref="goodsCrud"
+              :search.sync="search"
+              @search-change="searchChange"
+              @selection-change="selectionChange"
+              @row-click="rowClick"
+              :page.sync="page"
+              @on-load="onLoad"
+              @saveColumn="saveGoodsColumn"
+              @resetColumn="resetGoodsColumn"
+              :cell-style="cellStyle"
+            ></avue-crud>
+          </el-col>
+        </el-row>
+      </span>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="importGoods"
+          :disabled="selectionList.length == 0"
+        >导入</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import tableOption from "./config/customerContact.json";
+import goodsOption from "./config/commodity.json";
+import {getDeptLazyTree,
+  getGoods,} from "@/api/basicData/customerInquiry";
+
+export default {
+  name: "detail",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
+  data() {
+    return {
+      pageLoading: false,
+      form: {},
+      option: {
+        menuBtn: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: "供应商",
+            prop: "corpId",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "change"
+              }
+            ],
+            span: 16,
+            slot: true
+          },
+          {
+            label: "系统号",
+            prop: "sysNo",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "业务时间",
+            prop: "businesDate",
+            span: 8,
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ]
+          },
+          {
+            label: "电话",
+            prop: "corpTel",
+            span: 8
+          },
+          {
+            label: "地址",
+            prop: "arrivalAddress",
+            span: 8
+          },
+          {
+            label: "打印时间",
+            prop: "a",
+            span: 8,
+            disabled: true
+          },
+        ],
+      },
+      dataList: [],
+      tableOption: {},
+      dialogVisible: false,
+      selectionList: [],
+      treeDeptId: null,
+      reData: null,
+      treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        treeLoad: function(node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(
+              res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren
+                };
+              })
+            );
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          label: "title",
+          value: "value",
+          children: "children"
+        }
+      },
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      search: {},
+      goodsList: [],
+      loading: false,
+      goodsOption: {},
+      treeStyle: "height:" + (window.innerHeight - 315) + "px",
+      goodsoptions: [],
+    }
+  },
+  async created() {
+    this.tableOption = await this.getColumnData(
+      this.getColumnName(82),
+      tableOption
+    );
+    this.goodsOption = await this.getColumnData(
+      this.getColumnName(83),
+      goodsOption
+    );
+    getGoods(1, 500).then(res => {
+      this.goodsoptions = res.data.data.records;
+    });
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    openEdit() {},
+    copyDoc() {
+      this.$emit("copyOrder", this.form.id);
+    },
+    getCorpData(row) {},
+    //修改提交触发
+    editCustomer(status) {
+      this.$message.success('保存成功')
+    },
+    //返回列表
+    backToList() {
+      this.$emit("goBack");
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(82),
+        this.tableOption
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.tableOption = tableOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(82),
+        tableOption
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        setTimeout(() => {
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }, 1000);
+      }
+    },
+    //商品明细导入
+    newDetails() {
+      // if (!this.form.corpId) {
+      //   return this.$message.error("请选择客户名称");
+      // }
+      this.dialogVisible = !this.dialogVisible;
+    },
+    importGoods() {
+      if (this.reData) {
+        if (this.selectionList.length != 1) {
+          return this.$message.error("重新选择的时候只能选择一条数据");
+        } else {
+          this.selectionList.forEach(e => {
+            this.dataList.forEach((item, index) => {
+              if (index == this.reData.index) {
+                item.itemId = e.id;
+                item.code = e.code;
+                item.cname = e.cname;
+                item.corpId = e.corpId;
+                item.corpName = e.corpName;
+                item.brandItem = e.brandItem;
+                item.specsOne = e.specsOne;
+                item.specsTwo = e.specsTwo;
+                item.typeno = e.typeno;
+                item.priceCategory = e.goodsTypeName;
+                item.$cellEdit = true;
+              }
+            });
+          });
+        }
+      } else {
+        this.selectionList.forEach(e => {
+          this.dataList.push({
+            itemId: e.id,
+            code: e.code,
+            cname: e.cname,
+            brandItem: e.brandItem,
+            specsOne: e.specsOne,
+            specsTwo: e.specsTwo,
+            typeno: e.typeno,
+            corpId: e.corpId,
+            corpName: e.corpName,
+            price: 0,
+            amount: 0,
+            $cellEdit: true
+          });
+        });
+      }
+      this.dialogVisible = false;
+    },
+    closeGoods() {
+      this.selectionList = [];
+      this.treeDeptId = "";
+      this.reData = null;
+    },
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    //费用查询
+    onLoad(page, params = {}) {
+      let obj = this.deepClone(Object.assign(params, this.search));
+      this.loading = true;
+      getGoods(page.currentPage, page.pageSize, this.treeDeptId, obj)
+        .then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.goodsList = data.records;
+          if (this.page.total) {
+            this.goodsOption.height = window.innerHeight - 350;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    searchChange(params, done) {
+      this.search = this.deepClone(params);
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    rowClick(row) {
+      this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
+    },
+    async saveGoodsColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(83),
+        this.goodsOption
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetGoodsColumn() {
+      this.goodsOption = goodsOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(83),
+        goodsOption
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        setTimeout(() => {
+          this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
+        }, 1000);
+      }
+    },
+    openReport() {},
+    rowCell(row, index) {
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    rowDel(row, index) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        if (row.id) {
+        } else {
+          this.$message({
+            type: "success",
+            message: "删除成功!"
+          });
+          this.data.splice(row.$index, 1);
+        }
+      });
+    },
+    cnameChange(row) {
+      this.goodsoptions.forEach(e => {
+        if (e.id == row.itemId) {
+          row.cname = e.cname;
+          row.code = e.code;
+          row.corpId = e.corpId;
+          row.corpName = e.corpName;
+          row.brandItem = e.brandItem;
+          row.specsOne = e.specsOne;
+          row.specsTwo = e.specsTwo;
+          row.typeno = e.typeno;
+          row.priceCategory = e.goodsTypeName;
+          row.purchaseAmount = 0;
+          row.amount = 0;
+        }
+      });
+    },
+    rePick(row, index) {
+      this.reData = {
+        ...row,
+        index: index
+      };
+      this.newDetails();
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.trading-form ::v-deep .el-form-item {
+  margin-bottom: 8px !important;
+}
+::v-deep .el-form-item__error {
+  display: none !important;
+}
+::v-deep .select-component {
+  display: flex !important;
+}
+</style>

+ 259 - 0
src/views/dealer/purchase/index.vue

@@ -0,0 +1,259 @@
+<template>
+  <div>
+    <basic-container v-show="show" class="page-crad">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        :table-loading="loading"
+        :cell-style="cellStyle"
+        @selection-change="selectionChange"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        @search-criteria-switch="searchCriteriaSwitch"
+        @saveColumn="saveColumn"
+        @resetColumn="resetColumn"
+      >
+        <template slot="orderNo" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orderNo }}</span>
+        </template>
+        <template slot="corpId" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpsName }}</span>
+        </template>
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="small"
+            @click.stop="newAdd()"
+          >创建单据</el-button>
+          <el-button
+            type="success"
+            size="small"
+            icon="el-icon-plus"
+            @click.stop="copyDoc()"
+            :disabled="selection.length != 1"
+          >复制单据</el-button>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+          >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page
+      @goBack="goBack"
+      @copyOrder="copyOrder"
+      :detailData="detailData"
+      v-if="!show"
+    />
+  </div>
+</template>
+
+<script>
+import option from './config/mainList.json';
+import detailPage from "./detail";
+
+export default {
+  name: "index",
+  components: { detailPage },
+  data() {
+    return {
+      option: {},
+      dataList: [
+        {
+          id: 1,
+          orderNo: 'cg001',
+          sysNo: 'cgbh001',
+          corpId: '1',
+          corpsName: '张汉三',
+          businesDate: '2022-03-10',
+          tel: '19188887777'
+        },
+        {
+          id: 2,
+          orderNo: 'cg002',
+          sysNo: 'cgbh002',
+          corpId: '2',
+          corpsName: '李富贵',
+          businesDate: '2022-03-10',
+          tel: '18688882222'
+        },
+        {
+          id: 3,
+          orderNo: 'cg003',
+          sysNo: 'cgbh003',
+          corpId: '3',
+          corpsName: '王老五',
+          businesDate: '2022-03-10',
+          tel: '13570628888'
+        },
+        {
+          id: 4,
+          orderNo: 'cg004',
+          sysNo: 'cgbh004',
+          corpId: '4',
+          corpsName: '赵全蛋',
+          businesDate: '2022-03-10',
+          tel: '13899991234'
+        },
+        {
+          id: 5,
+          orderNo: 'cg005',
+          sysNo: 'cgbh005',
+          corpId: '5',
+          corpsName: '万大丫',
+          businesDate: '2022-03-10',
+          tel: '152890988876'
+        },
+      ],
+      form: {},
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 5,
+        pageSizes: [10, 50, 100, 200, 300, 400, 500]
+      },
+      search: {},
+      show: true,
+      loading: false,
+      selection: [],
+      detailData: {},
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(81), option);
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0){
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = window.innerHeight - 240 - 190
+      } else {
+        this.option.height = window.innerHeight - 240 + 190
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    newAdd() {
+      this.show = false;
+    },
+    copyDoc() {},
+    selectionChange(list) {
+      this.selection = list;
+    },
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.dataList.splice(row.$index, 1)
+        this.$message({
+          type: "success",
+          message: "删除成功!"
+        });
+      })
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.onLoad(this.page, params);
+      done();
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    onLoad(page, params) {
+      // this.option.height = window.innerHeight - 240;
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(81),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(this.getColumnName(81), option);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    goBack() {
+      if (this.$route.query.id) {
+        this.$router.$avueRouter.closeTag(this.$route.fullPath);
+        this.$router.push({
+          path: "/dealer/sales/index"
+        });
+      }
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+      this.onLoad(this.page, this.search);
+    },
+    copyOrder(id) {
+      this.show = true;
+      this.detailData = {
+        id: id,
+        status: "copy"
+      };
+      this.$nextTick(() => {
+        this.show = false;
+      });
+    },
+    beforeOpenPage(row, index) {
+      this.show = false;
+      this.detailData = {
+        id: row.id,
+        row: row
+      };
+    },
+  },
+}
+</script>
+
+<style scoped>
+::v-deep .select-component {
+  display: flex;
+}
+.page-crad ::v-deep .basic-container__card {
+  height: 94.2vh;
+}
+::v-deep .el-table__expanded-cell[class*="cell"] {
+  padding: 0px;
+}
+</style>

+ 80 - 0
src/views/dealer/sales/config/commodity.json

@@ -0,0 +1,80 @@
+{
+  "stripe": true,
+  "border": true,
+  "searchMenuSpan": 16,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "menu": false,
+  "align": "center",
+  "menuWidth": "180",
+  "selection": true,
+  "tip": false,
+  "column": [{
+      "label": "商品编号",
+      "prop": "code",
+      "index": 1,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "商品名称",
+      "search": true,
+      "searchSpan": 8,
+      "prop": "cname",
+      "index": 2,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "商品类别",
+      "prop": "goodsTypeName",
+      "index": 3,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "规格尺寸",
+      "prop": "typeno",
+      "index": 4,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "花纹",
+      "prop": "brandItem",
+      "index": 5,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "负荷指数",
+      "prop": "specsOne",
+      "index": 6,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "速级",
+      "prop": "specsTwo",
+      "index": 7,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "加强型",
+      "prop": "level",
+      "index": 8,
+      "width": 120,
+      "overHidden": true
+    }
+  ]
+}

+ 100 - 0
src/views/dealer/sales/config/customerContact.json

@@ -0,0 +1,100 @@
+{
+  "stripe": true,
+  "searchShow": true,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "addBtn": false,
+  "delBtn": false,
+  "align": "center",
+  "menuWidth": 120,
+  "refreshBtn": false,
+  "showSummary": true,
+  "column": [
+    {
+      "label": "产品编码",
+      "prop": "code",
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "商品名称",
+      "prop": "cname",
+      "index": 2,
+      "width": 200,
+      "overHidden": true
+    },
+    {
+      "label": "规格",
+      "prop": "typeno",
+      "index": 3,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "花纹",
+      "prop": "brandItem",
+      "index": 4,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "负荷指数",
+      "prop": "specsOne",
+      "index": 5,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "速度级别",
+      "prop": "specsTwo",
+      "index": 6,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "单位",
+      "prop": "a",
+      "index": 7,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "库存",
+      "prop": "storageQuantity",
+      "index": 8,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "数量",
+      "prop": "actualQuantity",
+      "index": 9,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "尺寸",
+      "prop": "size",
+      "index": 10,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "价格",
+      "prop": "price",
+      "index": 11,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "小计",
+      "prop": "amount",
+      "index": 12,
+      "width": 100,
+      "overHidden": true
+    }
+  ]
+}

+ 75 - 0
src/views/dealer/sales/config/mainList.json

@@ -0,0 +1,75 @@
+{
+  "stripe": true,
+  "height": "auto",
+  "searchShow": true,
+  "searchMenuSpan": 24,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "align": "center",
+  "menuWidth": "70",
+  "showSummary": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "selection": true,
+  "tip": false,
+  "searchSpan": 8,
+  "column": [
+    {
+      "label": "销售订单号",
+      "prop": "orderNo",
+      "search": true,
+      "index": 1,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "系统编号",
+      "prop": "sysNo",
+      "search": true,
+      "index": 2,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "客户名称",
+      "prop": "corpId",
+      "search": true,
+      "index": 3,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "业务时间",
+      "prop": "businesDate",
+      "search": true,
+      "index": 4,
+      "minWidth": 80,
+      "overHidden": true,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true
+    },
+    {
+      "label": "电话",
+      "prop": "tel",
+      "search": false,
+      "index": 5,
+      "minWidth": 80,
+      "overHidden": true
+    },
+    {
+      "label": "地址",
+      "prop": "attn",
+      "search": false,
+      "index": 6,
+      "minWidth": 80,
+      "overHidden": true
+    }
+  ]
+}

+ 625 - 0
src/views/dealer/sales/detail.vue

@@ -0,0 +1,625 @@
+<template>
+  <div class="borderless" v-loading="pageLoading">
+    <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>
+      <div class="add-customer-btn">
+        <el-button
+          type="primary"
+          size="small"
+          class="el-button--small-yh"
+          @click.stop="openEdit"
+        >编 辑</el-button>
+        <el-button
+          type="success"
+          :disabled="!form.id"
+          size="small"
+          @click="copyDoc"
+        >
+          复制单据
+        </el-button>
+        <el-button
+          type="primary"
+          @click="editCustomer"
+          size="small"
+        >保存数据
+        </el-button>
+      </div>
+    </div>
+    <div class="customer-main">
+      <containerTitle title="基础信息"/>
+      <basic-container :showBtn="true">
+        <avue-form
+          ref="form"
+          class="trading-form"
+          v-model="form"
+          :option="option"
+        >
+          <template slot="corpId">
+            <crop-select
+              v-model="form.corpId"
+              @getCorpData="getCorpData"
+              corpType="KH"
+            ></crop-select>
+          </template>
+          <template slot="storageId">
+            <warehouse-select
+              v-model="form.storageId"
+              :configuration="configurationWarehouse"/>
+          </template>
+        </avue-form>
+      </basic-container>
+      <containerTitle title="商品信息"/>
+      <basic-container>
+        <avue-crud
+          ref="crud"
+          :data="dataList"
+          :option="tableOption"
+          :cell-style="cellStyle"
+          @saveColumn="saveColumn"
+          @resetColumn="resetColumn"
+        >
+          <template slot="menuLeft">
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              size="small"
+              @click.stop="newDetails"
+            >录入明细</el-button>
+            <el-button
+              type="info"
+              icon="el-icon-printer"
+              size="small"
+              @click.stop="openReport()"
+            >报 表</el-button
+            >
+          </template>
+          <template slot="menu" slot-scope="{ row, index }">
+            <el-button
+              size="small"
+              icon="el-icon-edit"
+              type="text"
+              @click="rowCell(row, index)"
+            >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
+            >
+            <el-button
+              size="small"
+              icon="el-icon-delete"
+              type="text"
+              @click="rowDel(row, index)"
+            >删除</el-button
+            >
+          </template>
+          <template slot="cname" slot-scope="{ row, index }">
+            <span v-if="row.$cellEdit" style="display:flex">
+              <el-select
+                v-model="row.itemId"
+                placeholder="请选择"
+                size="small"
+                style="width:60%"
+                @change="cnameChange(row, index)"
+              >
+                <el-option
+                  v-for="item in goodsoptions"
+                  :key="item.id"
+                  :label="item.cname"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <el-button
+                icon="el-icon-search"
+                size="small"
+                @click="rePick(row, index)"
+              ></el-button>
+            </span>
+
+            <span v-else> {{ row.cname }}</span>
+          </template>
+          <template slot="actualQuantity" slot-scope="{ row, index }">
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.actualQuantity"
+              size="small"
+            ></el-input>
+            <span v-else>{{ row.actualQuantity }}</span>
+          </template>
+          <template slot="price" slot-scope="{ row, index }">
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.price"
+              size="small"
+            ></el-input>
+            <span v-else>{{ row.price }}</span>
+          </template>
+        </avue-crud>
+      </basic-container>
+    </div>
+    <el-dialog
+      title="导入商品"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="dialogVisible"
+      width="80%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      @close="closeGoods"
+      top="5vh"
+      v-dialog-drag
+    >
+      <span>
+        <el-row>
+          <el-col :span="4">
+            <div>
+              <el-scrollbar>
+                <basic-container>
+                  <avue-tree
+                    :option="treeOption"
+                    @node-click="nodeClick"
+                    :style="treeStyle"
+                  />
+                </basic-container>
+              </el-scrollbar>
+            </div>
+          </el-col>
+          <el-col :span="20">
+            <avue-crud
+              :option="goodsOption"
+              :table-loading="loading"
+              :data="goodsList"
+              ref="goodsCrud"
+              :search.sync="search"
+              @search-change="searchChange"
+              @selection-change="selectionChange"
+              @row-click="rowClick"
+              :page.sync="page"
+              @on-load="onLoad"
+              @saveColumn="saveGoodsColumn"
+              @resetColumn="resetGoodsColumn"
+              :cell-style="cellStyle"
+            ></avue-crud>
+          </el-col>
+        </el-row>
+      </span>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="importGoods"
+          :disabled="selectionList.length == 0"
+        >导入</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import tableOption from "./config/customerContact.json";
+import goodsOption from "./config/commodity.json";
+import {getDeptLazyTree,
+  getGoods,} from "@/api/basicData/customerInquiry";
+import {getUserInfo} from "@/api/system/user";
+import {selectGoodsNum} from "@/api/basicData/inventoryAccount"; // 库存查询
+
+export default {
+  name: "detail",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
+  data() {
+    return {
+      pageLoading: false,
+      form: {},
+      option: {
+        menuBtn: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: "客户名称",
+            prop: "corpId",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "change"
+              }
+            ],
+            span: 16,
+            slot: true
+          },
+          {
+            label: "系统号",
+            prop: "sysNo",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "业务时间",
+            prop: "businesDate",
+            span: 8,
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ]
+          },
+          {
+            label: "电话",
+            prop: "corpTel",
+            span: 8
+          },
+          {
+            label: "地址",
+            prop: "arrivalAddress",
+            span: 8
+          },
+          {
+            label: "打印时间",
+            prop: "a",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "客户欠款",
+            prop: "a",
+            span: 8,
+          },
+          {
+            label: "总数量",
+            prop: "b",
+            span: 8,
+          },
+          {
+            label: "应收金额",
+            prop: "c",
+            span: 8,
+          },
+          {
+            label: "总金额",
+            prop: "d",
+            span: 8,
+          },
+          {
+            label: "经办人",
+            prop: "e",
+            span: 8,
+          },
+          {
+            label: "制单人",
+            prop: "createUser",
+            span: 8,
+            disabled: true,
+          },
+          {
+            label: "结算方式",
+            prop: "paymentType",
+            span: 8,
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=payment_term",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            }
+          },
+          {
+            label: "配送方式",
+            prop: "f",
+            span: 8,
+          },
+          {
+            label: "发货仓库",
+            prop: "storageId",
+            span: 8,
+          },
+        ],
+      },
+      dataList: [],
+      tableOption: {},
+      dialogVisible: false,
+      selectionList: [],
+      treeDeptId: null,
+      reData: null,
+      treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        treeLoad: function(node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(
+              res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren
+                };
+              })
+            );
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          label: "title",
+          value: "value",
+          children: "children"
+        }
+      },
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      search: {},
+      goodsList: [],
+      loading: false,
+      goodsOption: {},
+      treeStyle: "height:" + (window.innerHeight - 315) + "px",
+      goodsoptions: [],
+      // 仓库配置
+      configurationWarehouse: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+      },
+    }
+  },
+  async created() {
+    this.tableOption = await this.getColumnData(
+      this.getColumnName(79),
+      tableOption
+    );
+    this.goodsOption = await this.getColumnData(
+      this.getColumnName(80),
+      goodsOption
+    );
+    getGoods(1, 500).then(res => {
+      this.goodsoptions = res.data.data.records;
+    });
+    getUserInfo().then(res => {
+      this.$set(this.form, 'createUser', res.data.data.realName)
+    })
+    if (this.detailData.id) {
+      this.$set(this.form, 'paymentType', '到付')
+      this.$set(this.form, 'id', this.detailData.id)
+      this.$set(this.form, 'businesDate', this.detailData.row.businesDate)
+      this.$set(this.form, 'corpId', this.detailData.row.corpsName)
+      this.$set(this.form, 'corpTel', '1918766221')
+      this.$set(this.form, 'arrivalAddress', '山东省青岛市')
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    openEdit() {},
+    copyDoc() {
+      this.$emit("copyOrder", this.form.id);
+    },
+    getCorpData(row) {},
+    //修改提交触发
+    editCustomer(status) {
+      this.$message.success('保存成功')
+    },
+    //返回列表
+    backToList() {
+      this.$emit("goBack");
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(79),
+        this.tableOption
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.tableOption = tableOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(79),
+        tableOption
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        setTimeout(() => {
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }, 1000);
+      }
+    },
+    //商品明细导入
+    newDetails() {
+      // if (!this.form.corpId) {
+      //   return this.$message.error("请选择客户名称");
+      // }
+      this.dialogVisible = !this.dialogVisible;
+    },
+    importGoods() {
+      if (this.reData) {
+        if (this.selectionList.length != 1) {
+          return this.$message.error("重新选择的时候只能选择一条数据");
+        } else {
+          this.selectionList.forEach(e => {
+            this.dataList.forEach((item, index) => {
+              if (index == this.reData.index) {
+                item.itemId = e.id;
+                item.code = e.code;
+                item.cname = e.cname;
+                item.corpId = e.corpId;
+                item.corpName = e.corpName;
+                item.brandItem = e.brandItem;
+                item.specsOne = e.specsOne;
+                item.specsTwo = e.specsTwo;
+                item.typeno = e.typeno;
+                item.priceCategory = e.goodsTypeName;
+                item.$cellEdit = true;
+              }
+            });
+          });
+        }
+      } else {
+        this.selectionList.forEach(e => {
+          this.dataList.push({
+            itemId: e.id,
+            code: e.code,
+            cname: e.cname,
+            brandItem: e.brandItem,
+            specsOne: e.specsOne,
+            specsTwo: e.specsTwo,
+            typeno: e.typeno,
+            corpId: e.corpId,
+            corpName: e.corpName,
+            price: 0,
+            amount: 0,
+            $cellEdit: true
+          });
+        });
+      }
+      this.dialogVisible = false;
+    },
+    closeGoods() {
+      this.selectionList = [];
+      this.treeDeptId = "";
+      this.reData = null;
+    },
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    //费用查询
+    onLoad(page, params = {}) {
+      let obj = this.deepClone(Object.assign(params, this.search));
+      this.loading = true;
+      getGoods(page.currentPage, page.pageSize, this.treeDeptId, obj)
+        .then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.goodsList = data.records;
+          if (this.page.total) {
+            this.goodsOption.height = window.innerHeight - 350;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    searchChange(params, done) {
+      this.search = this.deepClone(params);
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    rowClick(row) {
+      this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
+    },
+    async saveGoodsColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(80),
+        this.goodsOption
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetGoodsColumn() {
+      this.goodsOption = goodsOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(80),
+        goodsOption
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        //关闭窗口
+        setTimeout(() => {
+          this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
+        }, 1000);
+      }
+    },
+    openReport() {},
+    rowCell(row, index) {
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    rowDel(row, index) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        if (row.id) {
+        } else {
+          this.$message({
+            type: "success",
+            message: "删除成功!"
+          });
+          this.data.splice(row.$index, 1);
+        }
+      });
+    },
+    cnameChange(row) {
+      this.goodsoptions.forEach(e => {
+        if (e.id == row.itemId) {
+          row.cname = e.cname;
+          row.code = e.code;
+          row.corpId = e.corpId;
+          row.corpName = e.corpName;
+          row.brandItem = e.brandItem;
+          row.specsOne = e.specsOne;
+          row.specsTwo = e.specsTwo;
+          row.typeno = e.typeno;
+          row.priceCategory = e.goodsTypeName;
+          row.purchaseAmount = 0;
+          row.amount = 0;
+        }
+      });
+    },
+    rePick(row, index) {
+      this.reData = {
+        ...row,
+        index: index
+      };
+      this.newDetails();
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.trading-form ::v-deep .el-form-item {
+  margin-bottom: 8px !important;
+}
+::v-deep .el-form-item__error {
+  display: none !important;
+}
+::v-deep .select-component {
+  display: flex !important;
+}
+</style>

+ 217 - 0
src/views/dealer/sales/index.vue

@@ -0,0 +1,217 @@
+<template>
+  <div>
+    <basic-container v-show="show" class="page-crad">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        :table-loading="loading"
+        :cell-style="cellStyle"
+        @selection-change="selectionChange"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        @search-criteria-switch="searchCriteriaSwitch"
+        @saveColumn="saveColumn"
+        @resetColumn="resetColumn"
+      >
+        <template slot="orderNo" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orderNo }}</span>
+        </template>
+        <template slot="corpId" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpsName }}</span>
+        </template>
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="small"
+            @click.stop="newAdd()"
+          >创建单据</el-button>
+          <el-button
+            type="success"
+            size="small"
+            icon="el-icon-plus"
+            @click.stop="copyDoc()"
+            :disabled="selection.length != 1"
+          >复制单据</el-button>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+          >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page
+      @goBack="goBack"
+      @copyOrder="copyOrder"
+      :detailData="detailData"
+      v-if="!show"
+    />
+  </div>
+</template>
+
+<script>
+import option from './config/mainList.json';
+import detailPage from "./detail";
+
+export default {
+  name: "index",
+  components: { detailPage },
+  data() {
+    return {
+      option: {},
+      dataList: [
+        {id: 10, orderNo: 'xs00001', sysNo: 'xt00001', corpId: '1', corpsName: '张叁', businesDate: '2022-03-09'},
+        {id: 11, orderNo: 'xs00002', sysNo: 'xt00002', corpId: '2', corpsName: '李四', businesDate: '2022-03-09'},
+        {id: 12, orderNo: 'xs00003', sysNo: 'xt00003', corpId: '3', corpsName: '王五', businesDate: '2022-03-10'},
+      ],
+      form: {},
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 3,
+        pageSizes: [10, 50, 100, 200, 300, 400, 500]
+      },
+      search: {},
+      show: true,
+      loading: false,
+      selection: [],
+      detailData: {},
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(78), option);
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0){
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    searchCriteriaSwitch(type) {
+      if (type){
+        this.option.height = window.innerHeight - 240 - 190
+      }else {
+        this.option.height = window.innerHeight - 240 + 190
+      }
+      this.$refs.crud.getTableHeight()
+    },
+    newAdd() {
+      this.show = false;
+    },
+    copyDoc() {},
+    selectionChange(list) {
+      this.selection = list;
+    },
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.dataList.splice(row.$index, 1)
+        this.$message({
+          type: "success",
+          message: "删除成功!"
+        });
+      })
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.onLoad(this.page, params);
+      done();
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    onLoad(page, params) {
+      this.option.height = window.innerHeight - 240;
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(78),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(this.getColumnName(78), option);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    goBack() {
+      if (this.$route.query.id) {
+        this.$router.$avueRouter.closeTag(this.$route.fullPath);
+        this.$router.push({
+          path: "/dealer/sales/index"
+        });
+      }
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+      this.onLoad(this.page, this.search);
+    },
+    copyOrder(id) {
+      this.show = true;
+      this.detailData = {
+        id: id,
+        status: "copy"
+      };
+      this.$nextTick(() => {
+        this.show = false;
+      });
+    },
+    beforeOpenPage(row, index) {
+      this.show = false;
+      this.detailData = {
+        id: row.id,
+        row: row
+      };
+    },
+  },
+}
+</script>
+
+<style scoped>
+::v-deep .select-component {
+  display: flex;
+}
+.page-crad ::v-deep .basic-container__card {
+  height: 94.2vh;
+}
+::v-deep .el-table__expanded-cell[class*="cell"] {
+  padding: 0px;
+}
+</style>

+ 170 - 0
src/views/dealer/stock/config/mainList.json

@@ -0,0 +1,170 @@
+{
+  "align": "center",
+  "lazy": true,
+  "tip": false,
+  "searchMenuPosition": "right",
+  "simplePage": true,
+  "searchShow": true,
+  "dialogWidth": "60%",
+  "addBtn": false,
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 120,
+  "dialogClickModal": false,
+  "searchLabelWidth": 120,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "searchSpan": 8,
+  "column": [
+    {
+      "label": "品号",
+      "prop": "code",
+      "search": true,
+      "index": 1,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "名称",
+      "prop": "cname",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "花纹",
+      "prop": "brandItem",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "产地",
+      "prop": "placeProduction",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "规格",
+      "prop": "typeno",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "负荷指数",
+      "prop": "typenoOne",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "速级",
+      "prop": "typenoTwo",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "仓库名称",
+      "prop": "stockName",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "供应商",
+      "prop": "corpName",
+      "search": false,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "品牌",
+      "prop": "brand",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "总库存",
+      "prop": "balanceQuantity",
+      "search": false,
+      "index": 1,
+      "width": 100,
+      "cell": true,
+      "overHidden": true
+    },
+    {
+      "label": "内贸锁定",
+      "prop": "lockingQuantity",
+      "search": false,
+      "index": 1,
+      "width": 100,
+      "cell": true,
+      "overHidden": true
+    },
+    {
+      "label": "可用库存",
+      "prop": "surplusRouteQuantity",
+      "search": false,
+      "index": 1,
+      "width": 100,
+      "cell": true,
+      "overHidden": true
+    },
+    {
+      "label": "创建日期",
+      "type": "date",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "prop": "createTime",
+      "search": false,
+      "index": 1,
+      "width": 100,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "overHidden": true,
+      "pickerOptions": {}
+    },
+    {
+      "label": "创建人",
+      "prop": "createUserName",
+      "search": false,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "更新日期",
+      "prop": "updateTime",
+      "search": false,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "更新人",
+      "prop": "updateUserName",
+      "search": false,
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    }
+  ]
+}

+ 265 - 0
src/views/dealer/stock/index.vue

@@ -0,0 +1,265 @@
+<template>
+  <div>
+    <basic-container v-if="show">
+      <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">
+        <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-else>{{ scope.row.lockingQuantity }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="menu">
+          <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>
+        </template>
+        <template slot="menuLeft">
+          <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>
+          <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>
+    </basic-container>
+    <report-dialog
+      :switchDialog="switchDialog"
+      :searchValue="statementData"
+      :reportName="'国内贸易-库存账'"
+      @onClose="onClose()"
+    />
+  </div>
+</template>
+<script>
+import option from "./config/mainList.json"
+import {deleteTemplate,customerList,typeSave} from "@/api/basicData/inventoryAccount"
+import {getToken} from "@/util/auth";
+import { defaultDate } from "@/util/date";
+import reportDialog from "@/components/report-dialog/main";
+
+export default {
+  components:{
+    reportDialog
+  },
+  data() {
+    return {
+      data: [],
+      search:{},
+      loading: false,
+      exportLoading:false,
+      switchDialog:false,
+      statementData: {},
+      excelForm: {},
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: '导入数据',
+            prop: 'excelFile',
+            type: 'upload',
+            drag: true,
+            loadText: '导入数据中,请稍等',
+            span: 24,
+            propsHttp: {
+              res: 'data'
+            },
+            tip: '请上传 .xls,.xlsx 标准格式文件',
+            action: "/api/blade-stock/stockgoods/import-price"
+          }
+        ]
+      },
+      excelBox: false,
+      option: option,
+      page: {
+        pageSize: 10,
+        pagerCount: 5,
+        total: 0,
+        pageSizes: [10,50,100,200,300]
+      },
+      show: true,
+      params: {
+        corpId: null,
+        itemId: null
+      },
+    }
+  },
+  created() {
+    this.search.createTime = defaultDate(1)
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0){
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    derivation() {
+      this.$confirm("是否下载模板?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        window.open(`/api/blade-stock/stockgoods/export-template?${this.website.tokenHeader}=${getToken()}`);
+      });
+    },
+    uploadAfter(res, done, loading, column) {
+      console.log(res)
+      window.console.log(column);
+      this.excelBox = false;
+      this.page.currentPage = 1;
+      if (res) {
+        this.$message.warning(res)
+      } else {
+        this.$message.success('导入成功')
+      }
+      this.onLoad(this.page);
+      loading()
+      done();
+    },
+    rowCell(row, index) {
+      this.$refs.crud.rowCell(row, index)
+    },
+    deletePrice(row,index){
+      if (row.id){
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          return deleteTemplate(row.id);
+        }).then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.page.currentPage = 1;
+          this.onLoad(this.page);
+        })
+      }
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      if (params.createTime) {
+        params.createStartTime = params.createTime[0]+ " " + "00:00:00"
+        params.createEndTime = params.createTime[1]+ " " + "23:59:59"
+        delete params.createTime;
+      }
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done()
+    },
+    onLoad(page, params = {}) {
+      if (this.search.createTime && this.search.createTime.length > 0) {
+        params = {
+          ...params,
+          createStartTime: this.search.createTime[0]+ " " + "00:00:00",
+          createEndTime: this.search.createTime[1]+ " " + "23:59:59",
+        }
+        delete params.createTime;
+      }
+      let queryParams = Object.assign({}, params, {
+        size: page.pageSize,
+        current: page.currentPage,
+      })
+      this.loading = true;
+      customerList(queryParams).then(res => {
+        this.data = res.data.data.records
+        this.page.total = res.data.data.total
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+    rowUpdate(form, index, done) {
+      typeSave(form).then(res => {
+        this.$message({type: "success", message: form.id ? "修改成功!" : "新增成功!"});
+        // this.page.currentPage = 1;
+        // this.onLoad(this.page);
+        //成功关闭此页面回到列表页
+        // this.backToList()
+      })
+      done()
+    },
+    // 查看
+    viewCell(row, index) {
+      if (this.$store.getters.domStockDetail) {
+        this.$alert("明细已存在,请保存关闭明细再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: action => {
+            console.log(action);
+          }
+        });
+      } else {
+        this.params.corpId = row.corpId
+        this.params.itemId = row.goodsId
+        this.$router.$avueRouter.closeTag("/businessManagement/inventoryAccount/detail");
+        this.$router.push({
+          path: "/businessManagement/inventoryAccount/detail",
+          query: {
+            corpId: row.corpId,
+            itemId: row.goodsId
+          },
+        });
+      }
+      // this.show = false;
+    },
+    statement() {
+      this.statementData = {...this.search}
+      this.statementData.createStartTime = this.statementData.createTime[0]+ " " + "00:00:00"
+      this.statementData.createEndTime = this.statementData.createTime[1]+ " " + "23:59:59"
+      delete this.statementData.createTime
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.switchDialog = val;
+    },
+  }
+}
+</script>