| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504 |
- <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="inEdit">编 辑
- </el-button>
- <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
- :disabled="isSaveBtn" @click="editCustomer(0)">保 存
- </el-button>
- <el-button class="el-button--small-yh" v-if="form.id && form.status == 0" style="margin-left: 6px;"
- type="success" size="small" @click="editCustomer(1)" :disabled="form.status == 1">提 交
- </el-button>
- <!-- <el-dropdown v-if="form.status == 1">
- <el-button style="margin-left: 6px;" type="success" size="small">
- 审 核<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="auditPlan(2)">通过</el-dropdown-item>
- <el-dropdown-item @click.native="approve()">驳回</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown> -->
- </div>
- </div>
- <div style="margin-top: 50px">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- <template slot-scope="{row,index}" slot="contacts">
- <!-- 联系人 -->
- <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
- filterable allow-create default-first-option @change="contactsChange($event)"
- :disabled="editButton || form.status == 1">
- <el-option v-for="item in contactsOption" :key="item.cname" :label="item.cname"
- :value="item.contacts" />
- </el-select>
- </template>
- <tempalte slot="customerName">
- <dic-select v-model="form.customerName" placeholder="货主" key="id" label="cname" res="records"
- url="/blade-sales-part/corpsDesc/list?current=1&size=20&&enableOrNot=1" :filterable="true"
- :remote="true" dataName="cname" @selectChange="dicChange('customerName', $event)"
- :disabled="editButton || form.status == 1"></dic-select>
- </tempalte>
- <tempalte slot="storageName">
- <dic-select v-model="form.storageName" placeholder="仓库" key="id" label="cname" res="records"
- url="/blade-sales-part/tire/center/warehouse/storage/list?current=1&size=5"
- :filterable="true" :remote="true" dataName="cname"
- @selectChange="dicChange('storageName', $event)"
- :disabled="editButton || form.status == 1||form.planItemsList.length>0"></dic-select>
- </tempalte>
- <tempalte slot="warehouseKeeperName">
- <dic-select v-model="form.warehouseKeeperName" placeholder="库管" key="id" label="realName"
- res="records" url="/blade-user/page?current=1&size=5&userType=2" :filterable="true"
- :remote="true" dataName="realName" @selectChange="dicChange('warehouseKeeperName', $event)"
- :disabled="editButton || form.status == 1"></dic-select>
- </tempalte>
- </avue-form>
- </trade-card>
- <trade-card title="明细信息">
- <el-tabs v-model="activeName" type="card">
- <el-tab-pane label="出库明细" name="sale_detail">
- <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
- :data="form.planItemsList" :key="key"
- @row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
- @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 474)"
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 474)">
- <template slot-scope="{scope,row}" slot="menuLeft">
- <el-button type="primary" icon="el-icon-plus" size="small" :disabled="form.status == 1"
- @click="rowAdd(row, 1)">选择库存</el-button>
- <el-button type="success" size="small" :disabled="form.status == 1"
- icon="el-icon-bottom" @click="excelDialogfun('code')">按Code导入
- </el-button>
- <el-button type="primary" icon="el-icon-printer" size="small"
- @click="handlePrint">打印</el-button>
- <!-- <el-button type="danger" plain size="small" @click="batchDelete"
- :disabled="form.status == 1">一键删除</el-button> -->
- <!-- <el-popover width="600" trigger="click">
- <avue-crud :data="inventoryData" :option="inventoryOption"></avue-crud>
- <el-button type="primary" plain size="small" slot="reference" @click="viewInventory"
- :disabled="selectionMultilist.length != 1">查看库存</el-button>
- </el-popover> -->
- </template>
- <!-- <template slot="regionNameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.regionName" placeholder="库区" key="id"
- label="regionName"
- :url="'/blade-sales-part/tire/center/warehouse/storage-region/getRegionSelected?storageId=' + form.storageId"
- :filterable="true" :remote="true" dataName="regionName"
- @selectChange="rowDicChange('regionName', $event, row)"></dic-select>
- <span v-else>{{ row.regionName }}</span>
- </template> -->
- <template slot="goodsNumForm" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" size="small" v-model="row.goodsNum"
- :precision="numberDecimal" :controls="false" @blur="goodsNumblurfun(row)"
- style="width: 100%" @change="moneyChange(row)"></el-input-number>
- <span v-else>{{ row.goodsNum }}</span>
- </template>
- <!-- <template slot="price" slot-scope="{ row }">
- <el-input v-if="row.$cellEdit" size="small" v-model="row.price" style="width: 100%"
- @change="moneyChange(row)"></el-input>
- <span v-else>{{ row.price }}</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 :size="size" :disabled="editButton || form.status == 1 || row.isDeleted == 1"
- :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
- </el-button>
- <el-button :icon="row.isDeleted == 1 ? 'el-icon-refresh-left' : 'el-icon-delete'"
- :size="size" :disabled="editButton || form.status == 1" :type="type"
- @click="rowDel(row, index, 'planItemsList')">{{ row.isDeleted == 1 ? '恢复' :
- '删除' }}
- </el-button>
- </template>
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="收费明细" name="outbound_records">
- <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
- :data="form.centerShipCostList"
- @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 475)"
- @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 475)">
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editButton" circle
- @click="addRowD()">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="costNameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.costName" placeholder="费用名称" key="id"
- res="records" label="cname"
- url="/blade-sales-part/storageDesc/list?current=1&size=5" :filterable="true"
- :remote="true" dataName="cname"
- @selectChange="rowDicChange('costName', $event, row)"></dic-select>
- <span v-else>{{ row.costName }}</span>
- </template>
- <tempalte slot="costPriceForm" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.costPrice" @change="countChange(row)"
- :controls="false" placeholder="请输入 单价" size="small"
- style="width: 100%;"></el-input-number>
- <span v-else>{{ row.costPrice }}</span>
- </tempalte>
- <tempalte slot="goodsNumForm" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.goodsNum" @change="countChange(row)"
- :controls="false" placeholder="请输入 数量" size="small"
- style="width: 100%;"></el-input-number>
- <span v-else>{{ row.goodsNum }}</span>
- </tempalte>
- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button :size="size" :disabled="editButton || form.status == 1 || row.isDeleted == 1"
- :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
- </el-button>
- <el-button :icon="row.isDeleted == 1 ? 'el-icon-refresh-left' : 'el-icon-delete'"
- :size="size" :disabled="editButton || form.status == 1" :type="type"
- @click="rowDel(row, index, 'centerShipCostList')">{{ row.isDeleted == 1 ? '恢复' :
- '删除' }}
- </el-button>
- </template>
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="付费明细" name="outbound_records2">
- <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records2"
- :data="form.centerShipPaymentCostList"
- @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 475)"
- @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 475)">
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editButton" circle
- @click="addRowC()">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="costNameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.costName" placeholder="费用名称" key="id"
- res="records" label="cname"
- url="/blade-sales-part/storageDesc/list?current=1&size=5" :filterable="true"
- :remote="true" dataName="cname"
- @selectChange="rowDicChange('costName', $event, row)"></dic-select>
- <span v-else>{{ row.costName }}</span>
- </template>
- <tempalte slot="costPriceForm" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.costPrice" @change="countChange(row)"
- :controls="false" placeholder="请输入 单价" size="small"
- style="width: 100%;"></el-input-number>
- <span v-else>{{ row.costPrice }}</span>
- </tempalte>
- <tempalte slot="goodsNumForm" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.goodsNum" @change="countChange(row)"
- :controls="false" placeholder="请输入 数量" size="small"
- style="width: 100%;"></el-input-number>
- <span v-else>{{ row.goodsNum }}</span>
- </tempalte>
- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button :size="size" :disabled="editButton || form.status == 1 || row.isDeleted == 1"
- :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
- </el-button>
- <el-button :icon="row.isDeleted == 1 ? 'el-icon-refresh-left' : 'el-icon-delete'"
- :size="size" :disabled="editButton || form.status == 1" :type="type"
- @click="rowDel(row, index, 'centerShipPaymentCostList')">{{ row.isDeleted == 1 ? '恢复' :
- '删除' }}
- </el-button>
- </template>
- </avue-crud>
- </el-tab-pane>
- </el-tabs>
- </trade-card>
- <report-dialog :switchDialog="switchDialog" reportName="仓库管理-中心仓出库单" :reportId="form.id"
- @onClose="onClose()"></report-dialog>
- </div>
- <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" v-model="excelForm" table-loading="excelLoading"
- :upload-before="uploadBefore" :upload-after="uploadAfter">
- <template slot="excelTemplate">
- <el-button type="primary" @click="derivation">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- <p style="text-align: center;color: #DC0505">
- 温馨提示 第一次导入时请先下载模板
- </p>
- </el-dialog>
- <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">
- <el-row :style="{ height: rowHeight }">
- <el-col :span="5">
- <div>
- <el-scrollbar>
- <basic-container>
- <avue-tree style="height: 60vh;overflow-y: auto" :option="treeOption"
- :data="treeDataGoods" @node-click="nodeClick" />
- </basic-container>
- </el-scrollbar>
- </div>
- </el-col>
- <el-col :span="19">
- <basic-container>
- <avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="crud"
- :search.sync="SelectSearch" @refresh-change="refreshChange"
- @selection-change="selectionChange" @search-change="goodsSearch" :page.sync="page"
- @on-load="onLoadfun">
- <template slot="menuLeft">
- <el-tabs v-model="activeNameTabs" @tab-click="tabHandle">
- <el-tab-pane label="查询结果" name="searchList" />
- <el-tab-pane label="已选定数据" name="importStaging" />
- </el-tabs>
- </template>
- <template slot="goodsNum" slot-scope="{row}">
- <el-input-number v-model="row.goodsNum" size="small" :controls="false"
- :precision="numberDecimal" @input="amountChange($event, row)" style="width: 100%" />
- </template>
- <!-- <template slot="price" slot-scope="{row}">
- <el-input-number v-model="row.price" size="small" :controls="false"
- style="width: 100%" />
- </template> -->
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-edit" size="small"
- @click.stop="importStagList(scope.row, scope.index)"
- v-if="activeNameTabs == 'searchList'"
- :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
- </el-button>
- <el-button type="text" icon="el-icon-delete" size="small"
- @click.stop="removeStagList(scope.row, scope.index)" v-else>移除
- </el-button>
- </template>
- <template slot="inventory" slot-scope="scope">
- <span style="color: #489fef">
- {{ Number(scope.row.inventory) }}
- </span>
- </template>
- </avue-crud>
- </basic-container>
- </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>
- <!--<el-button type="primary" @click="importChoice" v-if="commodityData === true" :loading="saveLoading"-->
- <!-- :disabled="tableData.length !== 1">导入</el-button>-->
- </span>
- </el-dialog>
- <el-dialog title="驳回数据" append-to-body :visible.sync="approveVisible" width="30%" :close-on-click-modal="false"
- v-dialog-drag>
- <span>
- <el-input type="textarea" :rows="5" placeholder="请输入驳回原因" v-model="auditMsg">
- </el-input>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="approveVisible = false" size="mini">取消</el-button>
- <el-button type="danger" @click="approveVisible = false; auditPlan(3)" size="mini">确定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
- import { getDetails as getDetailsGods } from '@/api/tirePartsMall/basicData/commodityInformation'
- import { goodsListXs, goodsPageXs } from "@/api/tirePartsMall/salesManagement/saleOrder";
- import { getDetails, submitOutPlan, itemRemove, auditPlan } from "@/api/storehouse/plan.js";
- import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
- import reportDialog from "@/components/report-dialog/main";
- import { dateFormat } from "@/util/date";
- import checkSchedule from "@/components/checkL/checkSchedule";
- import check from "@/components/checkL/check";
- import commodityxsho from '../configuration/commodityxsho.json'
- import { getCorpTypes } from "@/api/tirePartsMall/basicData/commodityInformation";
- import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
- import { getToken } from "@/util/auth";
- import { isProcurement } from "@/api/basicData/configuration";
- import { getList as inventoryList } from "@/api/tirePartsMall/inventory";
- import dicSelect from "@/components/dicSelect/main";
- import { stockGoodsList } from "@/api/storehouse/stock.js";
- import _ from "lodash";
- export default {
- name: "detailsPage",
- data() {
- return {
- auditMsg: null,
- approveVisible: false,
- excelBox: false,
- inventoryData2: [],
- numberDecimal: 0,
- goodsType: 1,
- inventoryOption: {
- header: false,
- menu: false,
- column: [
- {
- label: '商品名称',
- prop: 'cname',
- overHidden: true,
- }, {
- label: '仓库',
- prop: 'storageName',
- overHidden: true,
- }, {
- label: '库存数量',
- prop: 'balanceQuantity',
- overHidden: true,
- }, {
- label: '批次号',
- prop: 'dot',
- overHidden: true,
- }
- ]
- },
- inventoryOption2: {
- header: false,
- menu: true,
- menuWidth: 90,
- editBtn: false,
- delBtn: false,
- column: [
- {
- label: '商品名称',
- prop: 'cname',
- overHidden: true,
- }, {
- label: '仓库',
- prop: 'storageName',
- overHidden: true,
- }, {
- label: '库存数量',
- prop: 'balanceQuantity',
- overHidden: true,
- }, {
- label: '批次号',
- prop: 'dot',
- overHidden: true,
- }
- ]
- },
- inventoryData: [],
- SelectSearch: {}, // 添加商品检索
- // 编辑还是保存
- mingxibaocun: true,
- // 批次号请求到的数据
- picihaolist: [],
- // 添加商品弹窗
- dialogVisible: false,
- // 弹窗高度
- rowHeight: '',
- // 左侧选择搜索
- treeDataGoods: [],
- treeDeptId: '',
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 50, 100, 300, 500]
- },
- pageList: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- // 左侧选择
- treeOption: {
- addBtn: false,
- menu: false,
- size: "small",
- props: {
- labelText: "标题",
- label: "title",
- value: "id",
- }
- },
- templateUrl: '', // 模板url
- // 表格需要的配置
- optionTwo: commodityxsho,
- loading: false,
- // 商品列表数据合计
- goodsListShow: [],
- // 商品列表暂存
- goodsListSave: [],
- saveLoading: false,
- commodityData: false,
- surplusRouteQuantityOption: [],
- tableData: [],
- // tabs切换
- activeNameTabs: 'searchList',
- data: [],
- courierCompaniesList: [],
- inventory: 0,
- isStatus: 1,
- goodsIdoptions: [],
- dicUrlWithCustomId: '',
- sharedCompanyId: 0,
- isAddBtn: true, // 添加商品的是否禁用
- isSaveBtn: false, // 大保存的是否禁用
- viewDisabled: false, // 大审批的是否禁用
- isAdd: false, // 表格按钮的是否点击
- editButton: false, // 大编辑大隐藏显示
- goods: [],
- isDisabled: false, // 表格删除的是否禁用
- isDisabledTask: false, // 撤销任务和生成任务的是否禁用
- contactsOption: [],
- isContacts: false, // 表单的联系人是否禁用
- checkData: {},
- buttonText: '生成任务', // 生成任务和撤销任务文本
- buttonColor: 'success', // 初始颜色为success 生成任务和撤销任务颜色状态
- checkScheduleDialog: false, // 审批进度的弹窗开启关闭
- isApplySettlement: true, // 申请退款的是否禁用
- isConfirmRefundBtn: true, // 确认退款的是否禁用
- isExamineBtn: true, // 审批是否禁用
- isRevocationRequest: true, // 撤销审核是否禁用
- checkDialog: false, // 审核弹窗的开启关闭
- checkId: '',
- batchNo: '',
- switchDialog: false, // 打印弹窗的开启和关闭
- activeName: "sale_detail",
- disabled: false, // 表格按钮的禁用
- key: 0,
- form: {
- planItemsList: [],
- centerShipCostList: [],
- centerShipPaymentCostList: [],
- status: 0,
- bsType: 'CP'
- },
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- 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"
- }
- ]
- },
- customerData: [], // 货主数据
- optionForm: {
- menuBtn: false,
- span: 8,
- disabled: false,
- labelWidth: 100,
- column: [{
- label: '货主',
- prop: "customerName",
- disabled: false,
- formslot: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: '联系人',
- type: "select",
- prop: "contacts",
- disabled: false,
- allowCreate: true,
- filterable: true,
- dicData: [],
- props: {
- label: 'address',
- value: 'id'
- },
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
- }, {
- label: '电话',
- disabled: false,
- prop: "phone",
- }, {
- label: '收货地址',
- prop: "recAddress",
- type: 'select',
- allowCreate: true,
- filterable: true,
- disabled: false,
- props: {
- label: 'address',
- value: 'address'
- },
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
- },
- {
- label: '仓库',
- prop: "storageName",
- type: 'select',
- disabled: false,
- // props: {
- // label: 'cname',
- // value: 'id'
- // },
- // dicUrl: '/api/blade-sales-part/tire/center/warehouse/storage/storageSelectedList',
- 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: "createUserName",
- disabled: true,
- },
- {
- label: '单据编号',
- prop: "ordNo",
- disabled: true,
- },
- {
- label: '配送方式',
- type: 'select',
- prop: "shipType",
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- value: '物流',
- },
- {
- label: '货运公司',
- type: 'select',
- prop: "logisticsCorpName",
- allowCreate: true,
- filterable: true,
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=tyre_express_company",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- },
- {
- label: '货运单号',
- disabled: false,
- prop: "expressNo"
- },
- {
- label: '库管',
- prop: "warehouseKeeperName"
- },
- {
- label: '备注',
- prop: "remarks",
- type: 'textarea',
- disabled: false,
- span: 24,
- minRows: 2
- }]
- },
- 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,
- selection: true,
- sumColumnList: [{
- name: "goodsNum",
- type: "sum"
- }, {
- name: "sendNum",
- type: "sum"
- }, {
- name: "profit",
- type: "sum"
- }, {
- name: "subTotalMoney",
- type: "sum"
- }, {
- name: "thisAmount",
- type: "sum"
- }, {
- name: "costprie",
- type: "sum"
- }, {
- name: "grossProfit",
- type: "sum"
- }, {
- name: "returnsNumber",
- type: "sum"
- }, {
- name: "returnsAmount",
- type: "sum"
- }],
- column: [
- {
- label: '入库单号',
- prop: 'billNo',
- width: 100,
- overHidden: true,
- },
- {
- label: '轮胎名称',
- prop: 'goodsName',
- width: 250,
- disabled: false,
- remote: true,
- overHidden: true,
- },
- {
- label: '库区',
- prop: 'regionName',
- // cell: true,
- // slot: true,
- // formslot: true,
- overHidden: true,
- // rules: [{
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }]
- },
- {
- label: '数量',
- prop: 'goodsNum',
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- // {
- // label: '价格',
- // prop: 'price',
- // overHidden: true,
- // width: 100
- // },
- {
- label: '库存',
- prop: 'inventory',
- overHidden: true,
- width: 100
- },
- {
- label: '批次号',
- prop: 'dot',
- width: 100,
- overHidden: true,
- },
- {
- label: '轮胎编码',
- prop: 'goodsNo',
- overHidden: true,
- disabled: false,
- width: 100
- },
- {
- label: '品牌',
- prop: 'brandName',
- disabled: false,
- width: 100,
- overHidden: true,
- },
- {
- 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: 'units',
- // type: "select",
- // disabled: false,
- // props: {
- // label: "dictValue",
- // value: "dictValue"
- // },
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
- overHidden: true,
- width: 100
- },
- // {
- // label: '发货数量',
- // prop: 'sendNum',
- // overHidden: true,
- // width: 100,
- // disabled: true,
- // editDisplay: false,
- // addDisplay: false
- // },
- // {
- // label: '小计',
- // prop: 'subTotalMoney',
- // overHidden: true,
- // width: 100,
- // disabled: true,
- // editDisplay: false,
- // addDisplay: false
- // },
- {
- label: '备注',
- prop: "remarks",
- overHidden: true,
- width: 100,
- disabled: false,
- }
- ]
- },
- selectionMultilist: [], // 多选数据
- optionOutboundRecords: {},
- optionOutboundRecordsBack: {
- height: 'auto',
- calcHeight: 30,
- menuWidth: 120,
- align: 'center',
- border: true,
- menu: true,
- refreshBtn: false,
- addBtn: false,
- span: 8,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: '费用名称',
- prop: 'costName',
- headerslot: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: '单价',
- prop: 'costPrice',
- headerslot: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: '数量',
- prop: 'goodsNum',
- headerslot: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: '金额',
- prop: 'costAmount',
- headerslot: true,
- },
- {
- label: '备注',
- prop: 'remark',
- cell: true,
- headerslot: true,
- }
- ]
- }
- }
- },
- components: { SearchQuery, reportDialog, check, checkSchedule, dicSelect },
- props: {
- onLoad: Object,
- detailData: Object
- },
- async created() {
- this.optionContacts = await this.getColumnData(this.getColumnName(474), this.optionContactsBack);
- this.optionOutboundRecords = await this.getColumnData(this.getColumnName(475), this.optionOutboundRecordsBack);
- this.key++
- if (this.onLoad.id && this.detailData.id) {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.editButton = true
- this.getDetail(this.onLoad.id, true)
- } else if (this.onLoad.id) {
- this.getDetail(this.onLoad.id, true)
- }
- isProcurement({ "param": "number.decimal" }).then(res => {
- this.numberDecimal = res.data.data ? Number(res.data.data) : 0
- })
- },
- methods: {
- inEdit() {
- if (this.form.status != 1) {
- this.editButton = false
- this.$set(this.optionForm, 'disabled', false)
- this.$set(this.optionContactsBack, 'disabled', false)
- }
- },
- countChange(row) {
- row.costAmount = _.multiply(Number(row.costPrice ? row.costPrice : 0), Number(row.goodsNum ? row.goodsNum : 0)).toFixed(2)
- },
- moneyChange(row) {
- row.subTotalMoney = _.multiply(Number(row.price ? row.price : 0), Number(row.goodsNum ? row.goodsNum : 0)).toFixed(2)
- },
- addRowD() {
- // if (!this.form.id) {
- // return this.$message.error('请保存数据')
- // }
- this.form.centerShipCostList.push({
- $cellEdit: true
- })
- },
- addRowC() {
- // if (!this.form.id) {
- // return this.$message.error('请保存数据')
- // }
- this.form.centerShipPaymentCostList.push({
- $cellEdit: true
- })
- },
- dicChange(name, row) {
- if (name == 'customerName') {
- if (row) {
- this.form.customerId = row.id
- getCustom({ id: row.id }).then(res => {
- if (res.data.data) {
- this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
- this.form.contacts = res.data.data.corpsAttnList[0].cname
- this.form.phone = res.data.data.corpsAttnList[0].tel
- this.contactsOption = res.data.data.corpsAddrList
- }
- })
- } else {
- this.form.customerId = null
- this.form.customerName = null
- this.dicUrlWithCustomId = null
- this.form.contacts = null
- this.form.phone = null
- }
- }
- if (name == 'warehouseKeeperName') {
- if (row) {
- this.form.warehouseKeeper = row.id
- // this.form.warehouseKeeperName=row.realName
- } else {
- this.form.warehouseKeeper = null
- this.form.warehouseKeeperName = null
- }
- }
- if (name == 'storageName') {
- if (row) {
- this.form.storageId = row.id
- this.form.storageName=row.cname
- } else {
- this.form.storageId = null
- this.form.storageName = null
- }
- }
- },
- rowDicChange(name, row, el) {
- if (name == 'costName') {
- if (row) {
- el.costId = row.id
- } else {
- el.costId = null
- el.costName = null
- }
- }
- if (name == 'regionName') {
- if (row) {
- el.regionId = row.id
- } else {
- el.regionId = null
- el.regionName = null
- }
- }
- },
- viewInventory() {
- this.inventoryData = []
- inventoryList({ cname: this.selectionMultilist[0].goodsName }).then(res => [
- this.inventoryData = res.data.data.records
- ])
- },
- uploadAfter(res, done, loading, column) {
- if (Array.isArray(res)) {
- if (res instanceof Array) {
- this.form.planItemsList = this.form.planItemsList.concat(res)
- res.forEach(item => {
- dotList({
- storageId: this.form.storageId,
- goodsId: res.goodsId
- }).then(e => {
- this.findObject(this.optionContactsBack.column, "dot").dicData = e.data.data
- })
- })
- }
- } else {
- this.$message.error(res)
- }
- loading = false;
- done(res);
- },
- derivation() {
- window.open(
- `${this.templateUrl}?${this.website.tokenHeader
- }=${getToken()}&stockId=${this.form.storageId}`
- );
- },
- uploadBefore(file, done, loading) {
- done();
- loading = true;
- },
- // 销售明细 导入按钮
- excelDialogfun(name) {
- if (!this.form.customerId) {
- this.$message.error('请选择货主')
- return
- }
- if (name == '名称') {
- this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-name'
- this.templateUrl = '/api/blade-sales-part/order/export-item-name'
- } else if (name == 'code') {
- this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-code?storageId=' + this.form.storageId
- this.templateUrl = '/api/blade-sales-part/order/export-item-code'
- }
- this.excelBox = true
- },
- // 获取左侧筛选
- getAllWorkDicts() {
- getCorpTypes({ whetherIntegral: '0' }).then(res => {
- this.treeDataGoods = res.data.data;
- });
- },
- //导入页左商品类型查询
- nodeClick(data) {
- this.treeDeptId = data.id;
- this.page.currentPage = 1;
- this.onLoadfun(this.page, { ...this.SelectSearch, goodsTypeId: this.treeDeptId });
- },
- closeGoods() {
- this.treeDataGoods = [];
- this.treeDeptId = "";
- this.activeNameTabs = "searchList";
- this.goodsType = 1
- },
- //刷新触发
- refreshChange() {
- this.page.currentPage = 1;
- this.onLoadfun(this.page);
- },
- //选中触发
- selectionChange(list) {
- this.tableData = list
- },
- // 点击搜索触发
- goodsSearch(params, done) {
- this.page.currentPage = 1;
- params = {
- ...params,
- artsVision: this.form.belongToCorpId,
- }
- // params.specificationAndModel = params.cname
- // delete params.cname
- this.onLoadfun(this.page, params);
- done()
- },
- // 标签页切换
- tabHandle(data) {
- if (data.name == 'searchList') {
- this.goodsListShow = this.data;
- this.page.total = this.pageList.total
- } else if (data.name == 'importStaging') {
- this.goodsListShow = this.goodsListSave;
- this.page.total = 0
- }
- },
- // 商品信息价格计算
- amountChange(value, row) {
- if (value > 0) {
- this.$refs.crud.toggleRowSelection(row, true);
- } else {
- this.$refs.crud.toggleRowSelection(row, false);
- }
- // 价格
- // if (!row.price) {
- // row.price = 0;
- // }
- },
- importStagList(row, index, type) {
- this.goodsListSave.push(row);
- },
- removeStagList(row, index, type) {
- this.goodsListSave.splice(row.$index, 1)
- },
- //确认导入触发
- async importGoods() {
- this.surplusRouteQuantityOption.push({ storageQuantity: '0' });
- if (this.goodsListSave.length > 0) {
- this.goodsListSaveHandle()
- } else {
- if (this.tableData.length > 0) {
- this.tableDataHandle()
- }
- }
- },
- // 导入按钮事件
- tableDataHandle() {
- // 循环获取库存数量
- for (let item of this.tableData) {
- let page = {}
- if (this.form.storageId) {
- page.storageId = this.form.storageId
- }
- page.goodsId = item.goodsId
- let obj = {
- billId: item.planId,
- billNo: item.planNo,
- goodsId: item.goodsId,
- price: item.price,
- goodsName: item.cname,
- goodsNum: item.goodsNum,
- brandName: item.brandName,
- brandId: item.brandId,
- goodsNo: item.code,
- propertyName: item.typeNo,
- inventory: item.balanceQuantity,
- pattern: item.brandItem,
- goodsDescription: item.goodsDescription,
- dot: item.dot,
- regionId: item.regionId,
- regionName: item.regionName,
- // poNo: item.poNo,
- whether: item.whether,
- units: item.unit,
- // 小计
- subTotalMoney: Number(item.goodsNum * item.price) ? Number(item.goodsNum * item.price).toFixed(2) : 0,
- // 备注
- remarks: item.remarks,
- // 批次号的状态
- dotedittype: false,
- // 价格数量
- goodsNumtype: false,
- // 价格
- pricetype: false,
- // sendNum: 0,
- // 是否是编辑状态
- $cellEdit: true
- }
- if (item.goodsFilesList && item.goodsFilesList.length) {
- for (let ite of item.goodsFilesList) {
- if (ite.version == '0') {
- obj.url = ite.url
- }
- }
- }
- this.form.planItemsList.push(obj)
- }
- this.mingxibaocun = false
- this.dialogVisible = false
- },
- // 导入
- goodsListSaveHandle() {
- this.tableData = this.goodsListSave
- this.tableDataHandle()
- },
- // 获取添加商品弹窗里的数据
- goodsPageXsfun() {
- goodsPageXs({
- customId: this.form.customerId,
- stock: this.form.storageId,
- enableOrNot: 1,
- whetherIntegral: '0'
- }).then(res => {
- const data = res.data.data;
- this.goodsListShow = data.records;
- })
- },
- //导入商品弹窗列表查询
- onLoadfun(page, params = { artsVision: this.form.belongToCorpId }) {
- this.goodsListShow = []
- this.loading = true;
- if (this.goodsType == 1) {
- stockGoodsList({
- current: page.currentPage,
- size: page.pageSize,
- customerId: this.form.customerId,
- storageId: this.form.storageId,
- goodsTypeId: this.treeDeptId,
- ...Object.assign(params, this.SelectSearch),
- whetherIntegral: '0'
- }).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.pageList.total = data.total
- this.data = data.records;
- this.goodsListShow = data.records;
- for (let item of this.goodsListShow) {
- item.goodsNum = item.goodsNum ? item.goodsNum : 0
- }
- this.loading = false;
- })
- }
- },
- // 数量失焦触发
- goodsNumblurfun(row) {
- if (Number(row.goodsNum) > Number(row.inventory)) {
- this.$message.warning("不能大于库存数量");
- return
- }
- },
- //联系人change
- contactsChange(e) {
- // 假设this.contactsOption是你的数组对象
- let matchedContact = this.contactsOption.find(item => item.contacts == e);
- // 判断是否找到匹配的对象
- this.$set(this.form, 'phone', matchedContact.tel)
- this.$set(this.form, 'recAddress', matchedContact.belongtoarea + matchedContact.detailedAddress)
- },
- //修改提交触发
- editCustomer(type) {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- for (let row of this.form.planItemsList.filter(item => item.isDeleted != 1)) {
- if (!row.goodsNum) {
- this.$refs.formContacts.rowCell(row, row.$index)
- return this.$message.error("请完善库存明细信息");
- }
- }
- for (let row of this.form.centerShipCostList.filter(item => item.isDeleted != 1)) {
- if (!row.costName || !row.goodsNum || !row.costPrice) {
- this.$refs.outbound_records.rowCell(row, row.$index)
- return this.$message.error("请完善收费明细信息");
- }
- }
- for (let row of this.form.centerShipPaymentCostList.filter(item => item.isDeleted != 1)) {
- if (!row.costName || !row.goodsNum || !row.costPrice) {
- this.$refs.outbound_records2.rowCell(row, row.$index)
- return this.$message.error("请完善付费明细信息");
- }
- }
- let obj = {
- ...this.form,
- status: type,
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submitOutPlan(obj).then(res => {
- this.$message.success("提交成功");
- this.getDetail(res.data.data)
- }).finally(() => {
- loading.close();
- });
- } else {
- return false;
- }
- });
- },
- //关闭弹窗表单
- beforeClose(done, type) {
- console.log('this.form.sharedCompanyId', this.form.sharedCompanyId);
- console.log('this.form.sharedCompanyName', this.form.sharedCompanyName);
- done()
- },
- getDetail(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
- this.$nextTick(() => {
- this.$refs.formContacts.doLayout()
- })
- if (res.data.data.status == 1) {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.editButton = true
- }
- }).finally(() => {
- loading.close();
- });
- },
- rowEdit(row, index) {
- if (row.$cellEdit) {
- this.$set(row, '$cellEdit', false)
- } else {
- this.$set(row, '$cellEdit', true)
- }
- },
- rowDel(row, index, list) {
- if (row.isDeleted == 1) {
- row.isDeleted = 0
- } else {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- // itemRemove({ ids: row.id }).then(res => {
- // this.form.planItemsList.splice(index, 1);
- // this.$message.success("操作成功!");
- // });
- row.isDeleted = 1
- this.$set(row, '$cellEdit', false)
- } else {
- this.form[list].splice(index, 1);
- }
- }
- );
- }
- },
- // 明细信息多选
- selectionContacts(list) {
- this.selectionMultilist = list
- },
- // 一键删除
- batchDelete() {
- if (this.selectionMultilist.length == 0) {
- return this.$message.warning('请选择要删除的数据')
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let multiList = this.selectionMultilist
- let arr = this.form.planItemsList
- // 获取有id 的数据
- const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
- // 把选中的删除掉
- multiList.forEach((item) => {
- for (let index in arr) {
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
- arr.splice(Number(index), 1)
- }
- }
- })
- // 有id 的处理
- if (itemsWithId.length != 0) {
- itemRemove({ ids: arrIds.join(',') }).then(res => {
- this.$message.success("操作成功!");
- });
- }
- })
- },
- approve(type) {
- this.approveVisible = true
- this.auditMsg = null
- },
- auditPlan(type) {
- if (type == 2) {
- this.$confirm('是否提交审核?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let obj = {
- id: this.form.id,
- status: type,
- auditMsg: type == 3 ? this.auditMsg : null,
- version: this.form.version
- }
- auditPlan(obj).then(res => {
- this.getDetail(this.form.id)
- })
- })
- }
- if (type == 3) {
- let obj = {
- id: this.form.id,
- status: type,
- auditMsg: type == 3 ? this.auditMsg : null,
- version: this.form.version
- }
- auditPlan(obj).then(res => {
- this.getDetail(this.form.id)
- })
- }
- },
- // 新增商品
- rowAdd(row, type) {
- if (!this.form.customerId) {
- this.$message.error('请选择货主')
- return
- }
- if (!this.form.storageId) {
- this.$message.error('请选择仓库')
- return
- }
- this.goodsType = type
- this.getAllWorkDicts()
- this.goodsListSave = []
- setTimeout(res => {
- this.refreshChange()
- this.dialogVisible = true
- }, 300)
- },
- //打印
- handlePrint() {
- this.switchDialog = !this.switchDialog;
- },
- onClose(val) {
- this.switchDialog = val;
- },
- //自定义列保存
- 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);
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-dialog__body {
- padding: 10px 20px;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- .el-form-item {
- margin-bottom: 0px !important;
- }
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- </style>
|