|
|
@@ -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--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>
|