Browse Source

轮胎盘点 2023-12-07

caojunjie 2 years ago
parent
commit
793a7bbb5f

+ 24 - 0
src/api/tirePartsMall/salesManagement/saleOrder.js

@@ -210,3 +210,27 @@ export const shortcutWarehousing = (data) => {
     data: data
   })
 }
+// 盘点列表
+export const inventoryList = (params) => {
+  return request({
+    url: '/api/blade-sales-part/inventory/list',
+    method: 'get',
+    params: params
+  })
+}
+// 盘点保存
+export const submitInventory = (data) => {
+  return request({
+    url: '/api/blade-sales-part/inventory/submitInventory',
+    method: 'POST',
+    data: data
+  })
+}
+// 盘点保存
+export const confirmInventory = (data) => {
+  return request({
+    url: '/api/blade-sales-part/inventory/confirmInventory',
+    method: 'POST',
+    data: data
+  })
+}

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

@@ -1160,6 +1160,9 @@ const columnName = [{
   code: 269.3,
   name: '轮胎商城-销售管理-明细-出库列表'
 },{
+  code: 269.4,
+  name: '轮胎商城-盘点-明细列表'
+},{
   code: 270,
   name: '轮胎商城-销售管理-出库工单-列表信息'
 },{

+ 14 - 1
src/router/views/index.js

@@ -2574,7 +2574,20 @@ export default [{
     },
     component: () => import( /* webpackChunkName: "views" */ '@/views/tirePartsMall/salesManagement/purchaseOrder/index')
   }]
-},{
+}, {
+    path: '/tirePartsMall/salesManagement/Inventory/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/tirePartsMall/salesManagement/Inventory/index',
+      name: '盘点(L)',
+      meta: {
+        i18n: '/tirePartsMall/salesManagement/Inventory/index',
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/tirePartsMall/salesManagement/Inventory/index')
+    }]
+  },{
   path: '/tirePartsMall/salesManagement/inboundTask/index',
   component: Layout,
   hidden: true,

+ 10 - 0
src/store/modules/ifdetail.js

@@ -24,6 +24,7 @@ const ifdetail = {
     xsStatus: false, //出口销售
     ltxsStatus: false,//轮胎销售
     purchaseStatus:false,//轮胎采购
+    Inventory:false, // 轮胎盘点
     bjStatus: false, //出口报价
     cgStatus: false, //出口采购
     officePurchaseStatus: false, // 办公采购
@@ -136,6 +137,15 @@ const ifdetail = {
     OUT_LTCG_STATUS(state) {
       state.purchaseStatus = false;
     },
+    //轮胎盘点
+    IN_PD_STATUS(state) {
+      state.Inventory = true;
+    },
+    //盘点关
+    OUT_PD_STATUS(state) {
+      state.Inventory = false;
+    },
+
     IN_BJ_STATUS(state) {
       state.bjStatus = true;
     },

+ 14 - 0
src/views/tirePartsMall/inventory/index.vue

@@ -15,6 +15,8 @@
             @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 268)" :page.sync="page">
             <template slot-scope="{type,size,row,$index}" slot="menuLeft">
               <el-button type="warning" icon="el-icon-download" size="small" @click="outExport">导出</el-button>
+                <el-button type="primary" icon="el-icon-printer" size="small"
+                           @click="handlePrint">打印</el-button>
             </template>
             <template slot-scope="{ row }" slot="balanceQuantity">
               <span style="color: #409EFF;cursor: pointer" @click.stop="storeInventoryOpen(row)">{{ row.balanceQuantity }}
@@ -24,6 +26,8 @@
         </el-col>
       </el-row>
     </basic-container>
+      <report-dialog :switchDialog="switchDialog" reportName="轮胎商城--盘库单" :reportId="form.id"
+                     @onClose="onClose()"></report-dialog>
   </div>
 </template>
 
@@ -31,11 +35,14 @@
 import { getList } from "@/api/tirePartsMall/inventory";
 import { getToken } from "@/util/auth";
 import { getCorpType } from "@/api/tirePartsMall/basicData/commodityInformation";
+import reportDialog from "@/components/report-dialog/main.vue";
 
 export default {
   name: "index",
+    components: {reportDialog},
   data() {
     return {
+        switchDialog:false, // 打印弹窗
       detailsOpen: false,
       treeData: [],
       loading: false,
@@ -264,6 +271,13 @@ export default {
       })
       window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
     },
+      // 打印
+      handlePrint(){
+          this.switchDialog = !this.switchDialog;
+      },
+      onClose(val) {
+          this.switchDialog = val;
+      },
     check(row) {
       this.form = row
       this.detailsOpen = true

+ 999 - 0
src/views/tirePartsMall/salesManagement/Inventory/detailsPage.vue

@@ -0,0 +1,999 @@
+<template>
+    <div>
+        <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(0)">返回列表
+                </el-button>
+            </div>
+            <div class="add-customer-btn">
+                <el-button class="el-button&#45;&#45;small-yh" style="margin-left: 6px;"
+                    type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
+                </el-button>
+                <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
+                           @click="editCustomer">保 存
+                </el-button>
+                <el-button class="el-button--small-yh" style="margin-left: 6px;" type="success" size="small"
+                    :disabled="form.status !== '录入'" @click="generateOutbound">
+                    确认盘点
+                </el-button>
+            </div>
+        </div>
+        <div style="margin-top: 50px">
+            <trade-card title="基础信息">
+                <avue-form :option="optionForm" v-model="form" ref="form">
+
+                </avue-form>
+            </trade-card>
+
+            <trade-card title="明细信息">
+                <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
+                           :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
+                           @row-close="rowClose" :before-close="beforeClose"
+                           @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.4)"
+                           @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.4)">
+                    <template slot-scope="{scope,row}" slot="menuLeft">
+                        <el-button type="primary" icon="el-icon-plus" size="small"
+                                   @click="rowAdd(row)">添加轮胎</el-button>
+                        <el-button type="success" size="small" icon="el-icon-bottom" @click="excelBox = true">导入
+                        </el-button>
+                        <!--<el-button type="primary" icon="el-icon-printer" size="small"-->
+                        <!--           @click="handlePrint">打印</el-button>-->
+                    </template>
+
+                    <template slot="sendNum" slot-scope="{ row }">
+                        <el-input v-if="!mingxibaocun" size="small" v-model="row.sendNum" style="width: 100%" @blur="sendNumBlur(row)"></el-input>
+                        <span v-else>{{ row.sendNum }}</span>
+                    </template>
+                    <template slot="remarks" slot-scope="{ row }">
+                        <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks" style="width: 100%"></el-input>
+                        <span v-else>{{ row.remarks }}</span>
+                    </template>
+
+                    <template slot-scope="{type,size,row,index,disabled}" slot="menu">
+                        <el-button v-if="mingxibaocun" :size="size" :type="type"
+                                   :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="hangeditBtn(row, index)">编辑
+                        </el-button>
+                        <el-button v-else :size="size" :type="type"
+                                   :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="hangbaocun(row, index)">保存
+                        </el-button>
+                        <el-button icon="el-icon-delete" :size="size"
+                                   :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
+                        </el-button>
+                    </template>
+                </avue-crud>
+            </trade-card>
+
+            <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
+            :close-on-click-modal="false" v-dialog-drag>
+            <avue-form :option="excelOption" table-loading="excelLoading" :upload-before="uploadBefore"
+                :upload-after="uploadAfter">
+            </avue-form>
+            <p style="text-align: center;color: #DC0505">
+                温馨提示 第一次导入时请先下载模板
+            </p>
+        </el-dialog>
+        </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">
+            <el-row :style="{ height: rowHeight }">
+                <el-col :span="4">
+                    <avue-tree ref="treeRef" :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;">
+                    </avue-tree>
+                </el-col>
+                <el-col :span="20">
+                    <avue-crud :option="inventoryOption" :search.sync="inventorySearch" v-model="inventoryForm"
+                               :table-loading="loading" :data="inventoryDataList" :page.sync="inventoryPage"
+                               ref="inventoryCrud" :key="key" @on-load="inventoryOnLoad" @search-change="searchChange" @refresh-change="refreshChange"
+                               :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch" @selection-change="selectionChange"
+                               @resetColumn="resetColumnTwo('inventoryCrud', 'inventoryOption', 'inventoryOptionList', 268)"
+                               @saveColumn="saveColumnTwo('inventoryCrud', 'inventoryOption', 'inventoryOptionList', 268)">
+                    </avue-crud>
+                </el-col>
+            </el-row>
+            <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" :loading="saveLoading">取 消</el-button>
+        <el-button type="primary" @click="importGoods" v-if="commodityData !== true" :loading="saveLoading">导入</el-button>
+      </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
+import {getDetails as getDetailsLT} from "@/api/tirePartsMall/basicData/commodityInformation/index"
+import { dateFormat } from "@/util/date";
+import { getToken } from "@/util/auth";
+import {
+    getDetails,
+    generateShipTask,
+    tradingBox,
+    delOrderItem,
+    checkOrder,
+    confirmRefund,
+    goodsListXs,
+    inboundTask,
+    checkOrderCG,
+    revokeCheckOrderCG,
+    revokeInboundTask,
+    goodsListAll,
+    shortcutWarehousing, submitInventory, confirmInventory
+} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
+import reportDialog from "@/components/report-dialog/main";
+import checkSchedule from "@/components/checkL/checkSchedule";
+import check from "@/components/checkL/check";
+import {getCorpType} from "@/api/tirePartsMall/basicData/commodityInformation"
+import { getList as inventoryGetList } from "@/api/tirePartsMall/inventory";
+import TicketDistribution from "../../../oceanShipping/maritimeExport/components/ticketDistribution.vue";
+import M from "minimatch";
+import da from "element-ui/src/locale/lang/da";
+import { number } from "echarts";
+import {getDeptLazyTreeTwo} from "@/api/basicData/basicFeesDesc";
+import commodity from "../../configuration/commodity.json";
+export default {
+    name: "detailsPage",
+    data() {
+        return {
+            // 添加轮胎弹窗左侧配置
+            treeOption: {
+                addBtn: false,
+                menu: false,
+                size: "small",
+                props: {
+                    labelText: "标题",
+                    label: "title",
+                    value: "value",
+                }
+            },
+            treeData: [], // 添加轮胎弹窗左侧数据
+            inventorySearch: {whether:'0'}, // 弹窗表格检索条件
+            inventoryForm: {}, // 弹窗条件
+            inventoryPage: {
+                pageSize: 20,
+                currentPage: 1,
+                total: 0,
+                pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+            },
+            inventoryDataList:[], // 弹窗数据
+            inventoryOption: {},
+            inventoryOptionList: {
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                index: true,
+                width: '100%',
+                span: 8,
+                border: true,
+                menu: false,
+                height: "auto",
+                searchMenuPosition: "right",
+                align: "center",
+                size: "small",
+                menuWidth: 140,
+                searchSpan: 8,
+                searchIcon: true,
+                searchIndex: 2,
+                highlightCurrentRow: true,
+                dialogWidth: "70%",
+                summaryText: "合计",
+                showSummary: true,
+                selection:true,
+                sumColumnList: [
+                    {
+                        name: 'balanceQuantity',
+                        type: 'sum',
+                        decimals: 0
+                    },
+                    {
+                        name: 'storeInventory',
+                        type: 'sum',
+                    },
+                    {
+                        name: 'inventoryAmount',
+                        type: 'sum',
+                    },
+                ],
+                column: [
+                    {
+                        label: '轮胎名称',
+                        prop: "cname",
+                        search: true,
+                        overHidden: true,
+                    },
+                    {
+                        label: '轮胎编码',
+                        prop: "code",
+                        search: true,
+                        overHidden: true,
+                    }, {
+                        label: '品牌',
+                        prop: "brandId",
+                        // searchProp: "brandId",
+                        search: true,
+                        overHidden: true,
+                        type: 'select',
+                        props: {
+                            label: 'cname',
+                            value: 'id'
+                        },
+                        dicUrl: '/api/blade-sales-part/brandDesc/listAllV1?type=PP&enableOrNot=1',
+                        width: 100
+                    }, {
+                        label: '规格型号',
+                        prop: "typeno",
+                        search: true,
+                        overHidden: true,
+                        width: 100
+                    }, {
+                        label: '花纹',
+                        prop: "brandItem",
+                        overHidden: true,
+                        width: 100
+                    }, {
+                        label: '轮胎描述',
+                        prop: "productDescription",
+                        overHidden: true,
+                        width: 100
+                    }, {
+                        label: '分类',
+                        prop: "goodsTypeId",
+                        overHidden: true,
+                        props: {
+                            label: 'title',
+                            value: 'value',
+                            children:'children'
+                        },
+                        dicUrl: '/api/blade-sales-part/goodsType/tree?corpType=SP',
+                        width: 100
+                    }, {
+                        label: '仓库',
+                        prop: "storageName",
+                        // searchProp: "storageId",
+                        search: true,
+                        overHidden: true,
+                        type: 'select',
+                        props: {
+                            label: 'cname',
+                            value: 'id'
+                        },
+                        dicUrl: '/api/blade-sales-part/storageDesc/listAll',
+                        width: 100
+                    }, {
+                        label: '库存数量',
+                        prop: "balanceQuantity",
+                        overHidden: true,
+                        width: 100
+                    }, {
+                        label: '库存单价',
+                        prop: "inventoryCostPrice",
+                        overHidden: true,
+                        width: 100
+                    }, {
+                        label: '批次',
+                        search: true,
+                        prop: "dot",
+                        overHidden: true,
+                        width: 100
+                    },
+                    // {
+                    //   label: '上架库存',
+                    //   prop: "storeInventory",
+                    //   overHidden: true,
+                    //   width: 100
+                    // },
+                    {
+                        label: '库存金额',
+                        prop: "inventoryAmount",
+                        overHidden: true,
+                        width: 100
+                    }, {
+                        label: '库存预警',
+                        prop: "inventoryAlert",
+                        overHidden: true,
+                        width: 100
+                    }, {
+                        label: '是否显示库存',
+                        prop: "whether",
+                        overHidden: true,
+                        search: true,
+                        type: 'select',
+                        showColumn: false,
+                        hide: true,
+                        width: 120,
+                        searchLabelWidth: 120,
+                        searchValue:'0',
+                        dicData: [{
+                            label: '是',
+                            value: '1'
+                        }, {
+                            label: '否',
+                            value: '0'
+                        }],
+                    }]
+            },
+            // 编辑还是保存
+            mingxibaocun:true,
+            // 添加轮胎弹窗
+            dialogVisible:false,
+            // 弹窗高度
+            rowHeight: '',
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+                pageSizes: [10, 50, 100, 300, 500]
+            },
+            loading: false,
+            // 商品列表暂存
+            goodsListSave: [],
+            saveLoading: false,
+            commodityData: false,
+            surplusRouteQuantityOption: [],
+            tableData: [],
+            data:[],
+            inventory: 0,
+            isStatus: 1,
+            excelBox:false,
+            // 轮胎名称
+            goodsIdoptions: [],
+            dataList: [],
+            dicUrlWithCustomId: '',
+            sharedCompanyId: 0,
+            isAddBtn: true,
+            isAdd: false,
+            editButton: false, // 编辑按钮和保存按钮的显示隐藏
+            isSaveBtn: false, // 保存的禁用
+            isDisabledTask: false, // 生成,撤销任务按钮是否禁用
+            isDisabled: false,
+            disabled: false,
+            key: 0,
+            excelOption: {
+                submitBtn: false,
+                emptyBtn: false,
+                column: [
+                    {
+                        label: "导入明细",
+                        prop: "excelFile",
+                        type: "upload",
+                        drag: true,
+                        loadText: "上传中,请稍等",
+                        accept: '.xls,.xlsx',
+                        span: 24,
+                        propsHttp: {
+                            res: "data"
+                        },
+                        tip: "请上传 .xls,.xlsx 标准格式文件",
+                        action: "/api/blade-sales-part/ship/import-item"
+                    }
+                ]
+            },
+            form: {
+                orderItemsList: [],
+                paymentRecordsList: [],
+                outboundRecordsList: []
+            },
+            optionForm: {
+                menuBtn: false,
+                span: 8,
+                disabled: false,
+                column: [
+                    {
+                        label: '仓库',
+                        prop: "storageId",
+                        type: 'select',
+                        disabled: false,
+                        props: {
+                            label: 'cname',
+                            value: 'id'
+                        },
+                        dicUrl: '/api/blade-sales-part/storageDesc/listAll',
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '业务日期',
+                        prop: "businesDate",
+                        searchProp:"businesDateList",
+                        disabled: false,
+                        type: "datetime",
+                        value: dateFormat(new Date(), 'yyyy-MM-dd'),
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd",
+                        rules: [
+                            {
+                                required: true,
+                                message: "",
+                                trigger: "blur"
+                            }
+                        ]
+                    },
+                    {
+                        label: '盘点人',
+                        prop: "salerId",
+                    },
+                    {
+                        label: '账面数量',
+                        prop: "goodsTotalNum",
+                        disabled: true
+                    },
+                    {
+                        label: '实际数量',
+                        prop: "goodsTotalShipNum",
+                        disabled: true
+                    },
+                    {
+                        label: '盈亏数量',
+                        prop: "profitLossNum",
+                        disabled: true
+                    },
+                    {
+                        label: '账面金额',
+                        prop: "totalMoney",
+                        disabled: true
+                    },
+                    {
+                        label: '实际金额',
+                        prop: "salesAmount",
+                        disabled: true
+                    },
+                    {
+                        label: '盈亏金额',
+                        prop: "profitLossAmount",
+                        disabled: true
+                    },
+                    {
+                        label: '单据编号',
+                        prop: "ordNo",
+                        disabled: true
+                    },
+                    {
+                        label: '备注',
+                        prop: "remarks",
+                        type: 'textarea',
+                        disabled: false,
+                        span: 16,
+                        minRows: 1
+                    }
+                ]
+            },
+            formContacts: {},
+            optionContacts: {},
+            optionContactsBack: {
+                disabled: false,
+                border: true,
+                align: 'center',
+                index: true,
+                addBtnText: "添加轮胎",
+                updateBtnText: '保存',
+                refreshBtn: false,
+                dialogDrag: true,
+                addBtn: false,
+                span: 8,
+                height: 500,
+                // 添加
+                addRowBtn: false,
+                // 保存按钮
+                editBtn: false,
+                // 航编辑开启
+                cellBtn:true,
+                rowKey:'ids',
+                delBtn: false,
+                menuWidth: 140,
+                dialogTop: 25,
+                dialogWidth: "80%",
+                summaryText: "合计",
+                showSummary: true,
+                sumColumnList: [{
+                    name: "goodsNum",
+                    type: "sum"
+                }, {
+                    name: "price",
+                    type: "sum",
+                    decimals: 2
+                }, {
+                    name: "sendNum",
+                    type: "sum",
+                    decimals: 2
+                }, {
+                    name: "subTotalMoney",
+                    type: "sum",
+                    decimals: 2
+                }],
+                column: [{
+                    label: '轮胎名称',
+                    prop: 'goodsId',
+                    width: 200,
+                    disabled: false,
+                    remote: true,
+                    hide:true,
+                    overHidden: true,
+                    type: 'select',
+                    // dicData: [],
+                    props: {
+                        label: 'cname',
+                        value: 'id'
+                    },
+                    // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
+                    dicUrl: "/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}&enableOrNot=1"
+                    // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
+                },{
+                    label: '轮胎名称',
+                    prop: 'goodsName',
+                    width: 200,
+                    disabled: false,
+                    remote: true,
+                    overHidden: true,
+                }, {
+                    label: '轮胎编码',
+                    prop: 'goodsNo',
+                    overHidden: true,
+                    disabled: false,
+                    width: 100
+                }, {
+                    label: '花纹',
+                    prop: 'pattern',
+                    overHidden: true,
+                    disabled: false,
+                    width: 100
+                }, {
+                    label: '批次号',
+                    prop: 'dot',
+                    cell:true,
+                    width:120,
+                    type: "select",
+                    disabled: true,
+                    allowCreate: true,
+                    filterable: true,
+                    dicData: [],
+                    props: {
+                        label: "dot",
+                        value: "dot"
+                    },
+                    dicUrl: "/api/blade-sales-part/stockDesc/dotList",
+                    overHidden: true,
+                },{
+                    label: '库存单价',
+                    prop: 'costprie',
+                    overHidden: true,
+                    width: 100,
+                    disabled: false,
+                }, {
+                    label: '账面数量',
+                    prop: 'inventory',
+                    overHidden: true,
+                    disabled: false,
+                    width: 100,
+                },{
+                    label: '账面金额',
+                    prop: 'price',
+                    overHidden: true,
+                    width: 100,
+                    disabled: false,
+                    cell:true,
+                    rules: [{
+                        required: true,
+                        message: " ",
+                        trigger: "blur"
+                    }, {
+                        validator: (rule, value, callback) => {
+                            if (value < 0) {
+                                callback(new Error("价格不能小于0"));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: "blur"
+                    }]
+                },
+                    {
+                        label: '实际数量',
+                        prop: 'sendNum',
+                        overHidden: true,
+                        disabled: false,
+                        cell:true,
+                        width: 100,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }, {
+                            validator: (rule, value, callback) => {
+                                console.log(this.formContacts.inventory);
+                                if (value < 0) {
+                                    callback(new Error("数量不能小于0"));
+                                } else {
+                                    callback();
+                                }
+                            },
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '实际金额',
+                        prop: 'subTotalMoney',
+                        overHidden: true,
+                        width: 100,
+                        disabled: false,
+                        cell:true,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }, {
+                            validator: (rule, value, callback) => {
+                                if (value < 0) {
+                                    callback(new Error("价格不能小于0"));
+                                } else {
+                                    callback();
+                                }
+                            },
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '盈亏数量',
+                        prop: 'profitLossNum',
+                        overHidden: true,
+                        disabled: false,
+                        width: 100
+                    },
+                    {
+                        label: '盈亏金额',
+                        prop: 'profitLossAmount',
+                        overHidden: true,
+                        width: 100,
+                        disabled: false,
+                    },
+                    {
+                        label: '备注',
+                        prop: "remarks",
+                        overHidden: true,
+                        width: 100,
+                        disabled: false,
+                    }
+                ]
+            },
+        }
+    },
+    components: { reportDialog, check, checkSchedule },
+    props: {
+        onLoad: Object,
+        detailData: Object
+    },
+    async created() {
+        // 明细的配置
+        this.optionContacts = await this.getColumnData(this.getColumnName(269.4), this.optionContactsBack);
+        // 弹窗的配置
+        this.inventoryOption = await this.getColumnData(this.getColumnName(268), this.inventoryOptionList);
+        if(this.detailData.id) {
+            this.editButton = true
+            this.refresh(this.detailData.id)
+        }
+        this.key++
+    },
+    watch: {
+
+    },
+    mounted() {
+        this.$nextTick(() => {
+            // 监听浏览器高度变化,改变表格高度
+            window.onresize = () => {
+                this.rowHeight = (window.innerHeight - 130) + 'px'
+            }
+        })
+    },
+    methods: {
+        nodeClick(data){
+            console.log(data,508)
+        },
+        // 添加轮胎左侧数据接口
+        getAllWorkDicts() {
+            getCorpType({ corpType: 'SP' }).then(res => {
+                this.treeData = res.data.data;
+            });
+        },
+
+        //确认导入触发
+        async importGoods() {
+            this.surplusRouteQuantityOption.push({ storageQuantity: '0' });
+            console.log(this.goodsListSave,'导入按钮')
+            console.log(this.surplusRouteQuantityOption,'导入按钮2')
+            console.log(this.tableData,'导入按钮3')
+            if (this.goodsListSave.length > 0) {
+                this.goodsListSaveHandle()
+            } else {
+                if (this.tableData.length > 0) {
+                    this.tableDataHandle()
+                }
+            }
+        },
+        // 导入按钮事件
+        tableDataHandle(){
+            // 循环获取库存数量
+            for(let item of this.tableData) {
+                console.log(item,'循环导入')
+                // brandId
+                // brandItem
+                // brandName
+                // goodsTypeId
+                // goodsTypeName
+
+                // 轮胎名称 goodsId cname
+                // 轮胎编码 code
+                // 花纹 productDescription
+                // 批次号 dot
+                // 库存成本 inventoryCostPrice
+                // 库存数量 balanceQuantity
+
+                // 库存金额 inventoryAmount
+                // 实际金额 = 实际数量 * 库存成本
+                // 盈亏 = 实际 - 库存
+                this.form.orderItemsList.push({
+                    brandId:item.brandId,
+                    brandItem:item.brandItem,
+                    brandName:item.brandName,
+                    goodsTypeId:item.goodsTypeId,
+                    goodsTypeName:item.goodsTypeName,
+                    goodsId:item.goodsId, // 轮胎名称id
+                    goodsName:item.cname, // 轮胎名称
+                    goodsNo:item.code, // 轮胎编码
+                    pattern:item.productDescription, // 花纹
+                    dot:item.dot, // 批次号
+                    costprie:item.inventoryCostPrice,// 库存成本
+                    inventory:item.balanceQuantity, // 账面数量
+                    price:item.inventoryAmount, // 账面金额
+                })
+            }
+            this.dialogVisible = false
+        },
+        // 导入
+        goodsListSaveHandle(){
+            this.tableData = this.goodsListSave
+            this.tableDataHandle()
+        },
+        // 明细行编辑
+        hangeditBtn(row,index){
+            this.mingxibaocun = false
+            console.log('明细编辑')
+        },
+        // 保存按钮
+        hangbaocun(row) {
+            this.mingxibaocun = true
+            console.log('从表保存按钮')
+        },
+        sendNumBlur(row){
+            // 实际金额 = 实际数量 * 库存成本
+            this.$set(row,'subTotalMoney',Number(row.sendNum) * Number(row.costprie))
+            // 盈亏 = 实际 - 库存
+            this.$set(row,'profitLossNum',Number(row.sendNum) - Number(row.inventory))
+            this.$set(row,'profitLossAmount',Number(row.subTotalMoney) - Number(row.price))
+        },
+        //表头编辑
+        confirmEditing() {
+            this.editButton = false // 让保存按钮出来
+            loading.close()
+        },
+        // 确认盘点
+        generateOutbound() {
+            if (!this.form.id) {
+                this.$message.error('请先保存')
+                return
+            }
+            const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+            });
+            confirmInventory(this.form).then(res=>{
+                this.$message.success("操作成功");
+                this.refresh(res.data.data.id)
+                loading.close();
+            }).finally(() => {
+                loading.close();
+            });
+        },
+        //修改提交触发
+        editCustomer() {
+            this.$refs["form"].validate((valid, done) => {
+                done();
+                if (valid) {
+                    for (let item of this.form.orderItemsList) {
+                        if (!item.sendNum) {
+                            this.$message.success('请填写手机金额');
+                            return
+                        }
+                    }
+                    const loading = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(255,255,255,0.7)'
+                    });
+                    submitInventory({
+                        bsType: "PD",
+                        ...this.form
+                    }).then(res => {
+                        this.$message.success("保存成功");
+                        this.refresh(res.data.data.id)
+                        this.mingxibaocun = true
+                        loading.close();
+                    }).finally(() => {
+                        loading.close();
+                    });
+                } else {
+                    return false;
+                }
+            });
+        },
+        //关闭弹窗表单
+        beforeClose(done, type) {
+            console.log(type);
+            done()
+        },
+        // 详情
+        refresh(id, type) {
+            const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+            })
+            getDetails({ id: id }).then(res => {
+                this.form = res.data.data
+                loading.close();
+            }).catch(() => {
+                loading.close();
+            })
+        },
+        // 明细删除
+        rowDelBox(row, index, type) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                if (row.id) {
+                    delOrderItem({ ids: row.id }).then(res => {
+                        this.form.orderItemsList.splice(index, 1);
+                        this.$message.success("操作成功!");
+                    });
+                } else {
+                    this.form[type].splice(index, 1);
+                    this.$message.success("操作成功!");
+                }
+            }
+            );
+        },
+        rowSave(form, done, loading) {
+            form.subTotalMoney = form.goodsNum * form.price
+            form.goodsName = form.$goodsId
+            if (this.isStatus) {
+                console.log(form);
+                done(form)
+            } else {
+                this.$message.error('请选择相同商户的轮胎')
+            }
+            console.log(form);
+        },
+        rowUpdate(form, index, done, loading) {
+            this.$set(form,'goodsName',form.$goodsId)
+            console.log(form);
+            done(form)
+        },
+        // 新增轮胎
+        rowAdd(row) {
+            // 判断仓库
+            if (!this.form.storageId) {
+                this.$message.warning('请选择仓库');
+                return
+            }
+            // 弹窗左侧数据获取
+            this.getAllWorkDicts()
+            // 弹窗右侧数据获取
+            this.inventoryOnLoad(this.inventoryPage, {...this.inventorySearch,storageId:this.form.storageId})
+            this.goodsListSave = [] // 多选的数据
+            this.dialogVisible = true
+        },
+        uploadAfter(res, done, loading, column) {
+            if (res instanceof Array) {
+                this.form.orderItemsList = this.form.orderItemsList.concat(res)
+            }
+            this.excelBox = false;
+            loading = false;
+            done(res);
+        },
+        uploadBefore(file, done, loading) {
+            done();
+            loading = true;
+        },
+        // 弹窗表格数据获取
+        inventoryOnLoad(page, params = {}) {
+            params = {
+                storageId:params.storageName,
+                current: page.currentPage,
+                size: page.pageSize,
+                ...Object.assign(params, this.inventorySearch)
+            }
+            this.loading = true
+            inventoryGetList(params).then(res => {
+                this.inventoryDataList = res.data.data.records
+                this.inventoryPage.total = res.data.data.total
+                this.$nextTick(() => {
+                    this.$refs.inventoryCrud.doLayout()
+                })
+                this.loading = false
+            }).finally(() => {
+                this.loading = false
+            })
+        },
+        // 多选
+        selectionChange(list){
+            this.goodsListSave = list
+        },
+        // 弹窗刷新
+        refreshChange() {
+            this.inventoryOnLoad(this.inventoryPage, this.inventorySearch)
+        },
+        // 弹窗搜索
+        searchChange(params, done) {
+            this.inventoryPage.currentPage = 1
+            done();
+            this.inventoryOnLoad(this.inventoryPage, params)
+        },
+        cellStyle() {
+            return "padding:0;height:40px;";
+        },
+        searchCriteriaSwitch() {
+            this.$refs.inventoryCrud.getTableHeight();
+        },
+        //自定义列保存
+        async saveColumnTwo(ref, option, optionBack, code) {
+            /**
+             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+             */
+            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        //自定义列重置
+        async resetColumnTwo(ref, option, optionBack, code) {
+            this[option] = this[optionBack];
+            const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+            if (inSave) {
+                this.$message.success("重置成功");
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        // 返回列表
+        backToList(type) {
+            this.$emit("backToList", type);
+        },
+        // 弹框的重置
+        resetCrud(){
+            this.$message.success("重置成功");
+        },
+        // 弹窗的保存
+        saveCrud(){
+            this.$message.success("保存成功");
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item {
+    margin-bottom: 8px !important;
+}
+</style>

+ 587 - 0
src/views/tirePartsMall/salesManagement/Inventory/index.vue

@@ -0,0 +1,587 @@
+<template>
+  <div>
+    <basic-container v-show="!detailsOpen">
+      <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
+        ref="crud" :key="key" @on-load="onLoad" @search-change="searchChange" @row-del="rowDel"
+        @expand-change="expandChange" @refresh-change="refreshChange"
+        @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 274.4)"
+        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 274.4)" :page.sync="page">
+        <template slot-scope="{ row }" slot="expand">
+          <avue-crud :data="row.itemData" :option="itemOption" :table-loading="row.itemLoading" :cell-style="cellStyle"
+            class="itemTable"></avue-crud>
+        </template>
+        <template slot-scope="{type,size,row,index}" slot="menu">
+          <!-- <el-button :size="size" :type="type" @click="check(row)">查看</el-button> -->
+          <!--  判断是否一键采购过 然后展示不同的判断按钮-->
+          <el-button v-if="row.shortcutWarehousingStatus == '1'" :size="size" :type="type"
+                     :disabled="row.status != '录入' && row.item >= 1"
+                     @click="$refs.crud.rowDel(row, index)">删除</el-button>
+
+          <el-button v-else :size="size" :type="type"
+            :disabled="row.status != '录入' && row.status != '待确认' && row.item >= 1 || row.numberRows >= 1"
+            @click="$refs.crud.rowDel(row, index)">删除</el-button>
+        </template>
+        <template slot="corpNameSearch">
+          <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>
+        </template>
+        <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+          <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">新建订单</el-button>
+          <el-button type="warning" icon="el-icon-download" size="small" @click="outExport">导出</el-button>
+        </template>
+        <template slot-scope="{ row, index }" slot="ordNo">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.ordNo }}
+          </span>
+        </template>
+        <template slot-scope="{ row, index }" slot="srcOrdNo">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 3)">{{ row.srcOrdNo }}
+          </span>
+        </template>
+
+      </avue-crud>
+    </basic-container>
+    <detailsPage v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>
+  </div>
+</template>
+
+<script>
+import { remove, getGoodsInfo, inventoryList} from "@/api/tirePartsMall/salesManagement/saleOrder";
+import detailsPage from "./detailsPage"
+import { getDetails } from "@/api/tirePartsMall/salesManagement/saleOrder";
+import {getToken} from "@/util/auth";
+
+export default {
+  name: "index",
+  components: {
+    detailsPage
+  },
+  data() {
+    return {
+      detailsOpen: false,
+      loading: false,
+      search: {},
+      form: {},
+      dataList: [],
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      key: 0,
+      itemOption: {
+        align: "center",
+        header: false,
+        border: true,
+        menu: false,
+        column: [
+          {
+            label: '轮胎名称',
+            prop: 'goodsId',
+            width: 200,
+            disabled: false,
+            remote: true,
+            overHidden: true,
+            type: 'select',
+            // dicData: [],
+            props: {
+              label: 'cname',
+              value: 'id'
+            },
+            dicUrl: "/api/blade-sales-part/goodsDesc/goodsListAll"
+          }, {
+            label: '数量',
+            prop: 'goodsNum',
+            overHidden: true,
+            disabled: false,
+            width: 100,
+            rules: [{
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }, {
+              validator: (rule, value, callback) => {
+                console.log(this.formContacts.inventory);
+                if (value < 0) {
+                  callback(new Error("数量不能小于0"));
+                } else {
+                  callback();
+                }
+              },
+              trigger: "blur"
+            }]
+          },
+          {
+            label: '价格',
+            prop: 'price',
+            overHidden: true,
+            width: 100,
+            disabled: false,
+            rules: [{
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }, {
+              validator: (rule, value, callback) => {
+                if (value < 0) {
+                  callback(new Error("价格不能小于0"));
+                } else {
+                  callback();
+                }
+              },
+              trigger: "blur"
+            }]
+          },
+          {
+            label: '库存',
+            prop: 'inventory',
+            overHidden: true,
+            hide: true,
+            width: 100
+          }, {
+            label: '批次号',
+            prop: 'dot',
+            type: "select",
+            disabled: true,
+            allowCreate: true,
+            filterable: true,
+            dicData: [],
+            props: {
+              label: "dot",
+              value: "dot"
+            },
+            dicUrl: "/api/blade-sales-part/stockDesc/dotList",
+            overHidden: true,
+          }, {
+            label: '轮胎编码',
+            prop: 'goodsNo',
+            overHidden: true,
+            disabled: false,
+            width: 100
+          },
+          // {
+          //   label: '品牌',
+          //   prop: 'brandId',
+          //   disabled: false,
+          //   width: 100,
+          //   overHidden: true,
+          //   type: 'select',
+          //   props: {
+          //     label: 'cname',
+          //     value: 'id'
+          //   },
+          //   dicUrl: '/api/blade-sales-part/brandDesc/listAll?type=PP'
+          // },
+          {
+            label: '品牌',
+            prop: 'brandName',
+            overHidden: true,
+            disabled: false,
+            width: 100
+          },
+          {
+            label: '规格型号',
+            prop: 'propertyName',
+            overHidden: true,
+            disabled: false,
+            width: 100
+          }, {
+            label: '花纹',
+            prop: 'pattern',
+            overHidden: true,
+            disabled: false,
+            width: 100
+          }, {
+            label: '轮胎描述',
+            prop: 'goodsDescription',
+            disabled: false,
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: '收货数量',
+            prop: 'sendNum',
+            disabled: false,
+            overHidden: true,
+            width: 100,
+            disabled: true,
+            editDisplay: false,
+            addDisplay: false
+          }
+        ]
+      },
+      option: {},
+      optionList: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: true,
+        span: 8,
+        border: true,
+        height: "auto",
+        searchMenuPosition: "right",
+        align: "center",
+        size: "small",
+        menuWidth: 50,
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        highlightCurrentRow: true,
+        expand: true,
+        expandWidth: 60,
+        dialogWidth: "70%",
+        summaryText: "合计",
+        showSummary: true,
+        sumColumnList: [{
+          name: 'goodsTotalNum',
+          type: 'sum',
+          decimals: 0
+        }, {
+          name: 'totalMoney',
+          type: 'sum',
+          decimals: 2
+        },],
+        column: [{
+          label: '采购单号',
+          prop: "ordNo",
+          search: true,
+          overHidden: true,
+        },
+        {
+          label: '所属公司',
+          prop: "salesCompanyName",
+          overHidden: true,
+        },{
+           label: '账面数量',
+           prop: "goodsTotalNum",
+           overHidden: true,
+        },{
+           label: '账面金额',
+           prop: "totalMoney",
+           overHidden: true,
+        },{
+           label: '实际数量',
+           prop: "goodsTotalShipNum",
+           overHidden: true,
+        },{
+           label: '实际金额',
+           prop: "salesAmount",
+           overHidden: true,
+        },{
+           label: '盈亏数量',
+           prop: "profitLossNum",
+           overHidden: true,
+        },{
+           label: '盈亏金额',
+           prop: "profitLossAmount",
+           overHidden: true,
+        }, {
+          label: '仓库',
+          prop: "storageId",
+          search: true,
+          // remote:true,
+          overHidden: true,
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/storageDesc/listAll?cname={{key}}',
+        }, {
+          label: '行数',
+          prop: "numberRows",
+          overHidden: true,
+        }, {
+          label: '数量',
+          prop: "goodsTotalNum",
+          overHidden: true,
+        }, {
+          label: '金额',
+          prop: "totalMoney",
+          overHidden: true,
+        }, {
+                label: '已付金额',
+                prop: "paymentAmountTl",
+                disabled: true
+            }, {
+          label: '状态',
+          prop: "status",
+          search: true,
+          overHidden: true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=procurement_Status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        },
+        {
+          label: '结算状态',
+          prop: "actualPaymentStatus",
+          searchProp:'actualPaymentType',
+          search: true,
+          overHidden: true,
+          type: 'select',
+          dicData: [
+            {
+              label: "待付款",
+              value: 1,
+            },
+            {
+              label: "已付款",
+              value: 2,
+            },
+            {
+              label: "尾款",
+              value: 3,
+            }
+          ],
+        },
+        {
+          label: "制单人",
+          prop: "createUserName",
+          searchProp: "createUser",
+          overHidden: true,
+          width: 100,
+          filterable: true,
+          remote: true,
+          type: "select",
+          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+          props: {
+            label: "account",
+            value: "id",
+            res: 'data.records'
+          }
+        }, {
+          label: "制单日期",
+          prop: "createTime",
+          searchProp: "createTimeList",
+          type: "date",
+          overHidden: true,
+          width: 100,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: '业务日期',
+          prop: "businesDate",
+          searchProp: "businesDateList",
+          type: "date",
+          overHidden: true,
+          search: true,
+          width: 100,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: "更新人",
+          prop: "updateUserName",
+          searchProp: "updateUser",
+          overHidden: true,
+          width: 100,
+          filterable: true,
+          remote: true,
+          type: "select",
+          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+          props: {
+            label: "account",
+            value: "id",
+            res: 'data.records'
+          }
+        }, {
+          label: "更新日期",
+          prop: "updateTime",
+          searchProp: "updateTimeList",
+          type: "date",
+          overHidden: true,
+          width: 100,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }]
+      }
+    }
+  },
+  activated() {
+    setTimeout(() => {
+      console.log(this.$route.query,400);
+        // 主页快捷跳转来的 直接打开新建订单
+        if (this.$route.query.showTrue) {
+            this.$store.commit("IN_PD_STATUS");
+            this.detailsOpen = true;
+        }
+      if (this.$route.query.check) {
+        this.editOpen({ id: this.$route.query.check.srcBillId }, 1)
+        this.$store.commit("OUT_PD_STATUS");
+      }
+      if(this.$route.query.type == 'F'){
+        this.editOpen({ id: this.$route.query.detail.srcParentId }, 1)
+      }
+      this.detailData = {
+        id: this.$route.query.check.billId,
+        check: this.$route.query.check,
+        auditId: this.$route.query.check.id
+      };
+    }, 100);
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(274.4), this.optionList);
+    this.key++
+    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: {
+      // 导出
+      outExport() {
+          let config = { params: { ...this.search } }
+          if (config.params) {
+              for (const propName of Object.keys(config.params)) {
+                  const value = config.params[propName];
+                  if (value !== null && typeof (value) !== "undefined") {
+                      if (value instanceof Array) {
+                          for (const key of Object.keys(value)) {
+                              let params = propName + '[' + key + ']';
+                              config.params[params] = value[key]
+                          }
+                          delete config.params[propName]
+                      }
+                  }
+              }
+          }
+          config.params.bsType = 'PD'
+          const routeData = this.$router.resolve({
+              path: '/api/blade-sales-part/inventory/listExport',      //跳转目标下载地址
+              query: {
+                  ...config.params    //括号内是要传递给新窗口的参数
+              }
+          })
+          window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+      },
+    check(row) {
+      this.form = row
+      this.detailsOpen = true
+    },
+    backToList(type) {
+      this.form = {}
+      this.detailsOpen = false
+      if (type === 0) {
+        this.detailData = {}
+      }
+      this.$store.commit("OUT_LTCG_STATUS");
+      this.onLoad(this.page, this.search)
+    },
+    editOpen(row, status) {
+      this.form = row
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      console.log(status);
+      this.$store.commit("OUT_PD_STATUS");
+      this.detailsOpen = true;
+    },
+    //刷新
+    refreshChange() {
+      this.onLoad(this.page, this.search)
+    },
+    rowDel(form, index) {
+      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        remove({ id: form.id }).then(res => {
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+          this.dataList.splice(index, 1);
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+      });
+    },
+      // 点击搜索触发
+    searchChange(params, done) {
+        this.page.currentPage = 1
+      done();
+      this.onLoad(this.page, params)
+    },
+    onLoad(page, params = {}) {
+      params = {
+        ...params,
+        current: page.currentPage,
+        size: page.pageSize,
+        bsType: "PD",
+        ...Object.assign(params, this.search)
+      }
+      this.loading = true
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false);
+      });
+      inventoryList(params).then(res => {
+        if (res.data.data.records) {
+          res.data.data.records.forEach(e => {
+            e.itemLoading = true;
+          });
+        }
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+        this.loading = false
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    expandChange(row) {
+      if (!row.itemData) {
+        getDetails({ id: row.id})
+          .then(res => {
+            this.dataList[row.$index].itemData = res.data.data.orderItemsList;
+          })
+          .finally(() => {
+            this.dataList[row.$index].itemLoading = false;
+          });
+      }
+    },
+    //自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    }
+  }
+}
+</script>
+
+<style scoped></style>