123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686 |
- <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>
- <el-button v-if="detailData.id" type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList(1)">返回审核列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button class="el-button--small-yh" style="margin-right: 10px" type="primary" size="small" :disabled="form.status>0"
- @click="confirmEdit" v-if="optionForm.disabled === true">编辑
- </el-button>
- <el-dropdown style="margin-right: 10px">
- <el-button type="primary" size="small">
- 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="pleaseCheck" :disabled="form.status>0">请核数据</el-dropdown-item>
- <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id">审核进度</el-dropdown-item>
- <el-dropdown-item @click.native="repealCancel" :disabled="form.status === 0 || !form.status" v-if="!detailData.id">撤销请核</el-dropdown-item>
- <el-dropdown-item @click.native="checkDialog = true,checkData = detailData.check;" v-if="detailData.id">特殊审批
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-button class="el-button--small-yh" type="primary" size="small" :disabled="form.status>0"
- @click="editCustomer">
- 保存数据
- </el-button>
- </div>
- </div>
- <trade-card title="基础资料" style="margin-top: 50px">
- <avue-form :option="optionForm" v-model="form" ref="form">
- <template slot="purchaseCompanyId" slot-scope="scope">
- <crop-select v-model="form.purchaseCompanyId" @getCorpData="(row)=>{getGSData(row,['form','purchaseCompanyName'])}" :disabled="scope.disabled"
- corpType="KH"/>
- </template>
- </avue-form>
- </trade-card>
- <trade-card title="箱信息">
- <avue-crud
- :option="option"
- :data="dataList"
- v-model="formTwo"
- :table-loading="loading"
- :search.sync="search"
- :page.sync="page"
- @on-load="xiangpage"
- @search-change="searchChange"
- @search-reset="resetChange"
- ref="crud"
- :key="key"
- :before-open="beforeOpen"
- :upload-delete="uploadDelete"
- @row-save="rowSave"
- @row-update="rowUpdate"
- @selection-change="selectionChange"
- @resetColumn="resetColumnTwo('crud','option','optionBack',248.1)"
- @saveColumn="saveColumnTwo('crud','option','optionBack',248.1)">
- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type"
- @click="xiangbianji(row,index)">编辑
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled || row.count > 0" :type="type"
- @click="rowDel(row,index,'MX')">删除
- </el-button>
- </template>
- <template slot-scope="{ row }" slot="status">
- <span v-for="item in $refs.crud.DIC.status" :style="{color: item.colour}" v-if="item.dictKey == row.status">{{item.dictValue}}</span>
- </template>
- <template slot="addressForm" slot-scope="scope">
- <port-info v-model="formTwo.addressId" type="id" :disabled="scope.disabled" @balabalaTow="(val)=>{balabala(val,['formTwo','address'])}"/>
- </template>
- <!-- <template slot="boxMakingCompanyForm" slot-scope="scope">-->
- <!-- <crop-select v-model="formTwo.boxMakingCompanyId" :disabled="scope.disabled" :refresh="false"-->
- <!-- @getCorpData="(row)=>{getGSData(row,['formTwo','boxMakingCompany'])}" corpType="GS"/>-->
- <!-- </template>-->
- <template slot="menuLeft" slot-scope="scope">
- <el-button type="primary" size="small" @click="rowaddfun">录入明细</el-button>
- <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '录入'}) == -1?true:false)" type="primary" size="small"
- @click="statusUpdate('0','起租')">起租
- </el-button>
- <el-button :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用'}) == -1?true:false)" type="primary" size="small"
- @click="statusUpdate('1','退租')">退租
- </el-button>
- <el-button
- :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '待使用'}) == -1?true:false)"
- type="primary" size="small"
- @click="statusUpdate('1','撤销退租')">撤销退租
- </el-button>
- <el-button
- :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用'}) == -1?true:false)"
- type="primary" size="small"
- @click="statusUpdate('2','计算租金')">计算租金
- </el-button>
- <el-button
- :disabled="selectionList.length === 0 || option.disabled || (selectionList.findIndex(function(item){return item.status == '使用' && item.count > 0}) == -1?true:false)"
- type="primary" size="small"
- @click="statusUpdate('3','撤销租金')">撤销租金
- </el-button>
- <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom" @click="importBox">
- 导入
- </el-button>
- <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">
- 报表打印
- </el-button>
- <el-button style="margin-left: 0" type="success" size="small"
- :disabled="storeUp || selectionList.length === 0"
- @click="stockpiling()">堆存
- </el-button>
- </template>
- </avue-crud>
- </trade-card>
- <!-- 报表-->
- <report-dialog
- :switchDialog="switchDialog"
- :reportId="form.id"
- reportName="租出"
- @onClose="onClose()"
- />
- <!-- 费用信息组件-->
- <box-cost v-model="dataListTwo" :id="form.id" :printingIsDisabled="false" type="ZC" activeName="first" :codeValue="248.2" ref="boxCost"
- @resetTrigger="resetTrigger"></box-cost>
- <trade-card title="附件明细">
- <c-upload
- basic
- :data="tradingBoxFilesList"
- :disabled="disabled"
- deleteUrl="/api/blade-box-tube/tradingBoxFiles/remove"
- :enumerationValue="248.3"
- display
- />
- </trade-card>
- <el-dialog
- :title="title"
- :visible.sync="dialogVisible"
- :append-to-body="true"
- :destroy-on-close="true"
- :close-on-click-modal="false"
- v-if="dialogVisible"
- width="60%">
- <span>
- <avue-form v-if="title == '堆存'" :option="optionStateTwoTwo" v-model="formState" ref="formState">
- <template slot="addressId" slot-scope="scope">
- <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
- @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
- </template>
- <template slot="purchaseCompanyId" slot-scope="scope">
- <crop-select v-model="formState.purchaseCompanyId"
- @getCorpData="(row)=>{getGSData(row,['formState','purchaseCompanyName'])}"
- :disabled="scope.disabled"
- corpType="KH"/>
- </template>
- </avue-form>
- <avue-form v-else :option="optionState" v-model="formState" ref="formState">
- <template slot="addressId" slot-scope="scope">
- <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
- @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
- </template>
- </avue-form>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" :disabled="disabledVisible" @click="confirmChange">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog title="导入箱档案" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
- v-dialog-drag>
- <avue-form v-if="excelBox" :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
- append-to-body
- title="审批进度"
- class="el-dialogDeep"
- :visible.sync="checkScheduleDialog"
- width="40%"
- :close-on-click-modal="false"
- :destroy-on-close="true"
- :close-on-press-escape="false"
- v-dialog-drag
- >
- <check-schedule
- :checkId="checkId"
- :batchNo="batchNo"
- @choceScheduleFun="choceScheduleFun"
- ></check-schedule>
- </el-dialog>
- <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
- </check>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- detail,
- submit,
- tradingBoxFiles,
- selectArchivesList,
- tradingBoxItem,
- tradingBoxFees,
- pleaseCheck,
- repealCancel,
- statusUpdate, calculateRent, revokeRent, itemDetails, revokeRentingOut, detList, tradingBoxItemSubmitRent
- } from "@/api/boxManagement/leaseIn/index.js";
- import checkSchedule from "@/components/check/checkSchedule";
- import {selectByName} from "@/api/boxManagement";
- import {getToken} from "@/util/auth";
- import {dateFormat} from "@/util/date";
- import reportDialog from "@/components/report-dialog/main.vue";
- import {generateStack} from "@/api/boxManagement/exportShipment";
- import check from "@/components/check/check.vue";
- export default {
- name: "detailsPage",
- props: {
- onLoad: Object,
- detailData: Object
- },
- components:{checkSchedule,reportDialog,check},
- data() {
- return {
- // 箱管理编辑暂存的箱号
- ZCcode:null,
- // 分页
- page: {
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 2000]
- },
- checkData: {},
- checkDialog: false,
- switchDialog:false,
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- label: "模板上传",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "模板上传中,请稍等",
- span: 24,
- propsHttp: {
- res: "data"
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-box-tube/tradingBoxRent/import-tradingBox-info"
- }
- ]
- },
- excelForm: {},
- title: '',
- dialogVisible: false,
- excelBox: false,
- formSearch: {},
- optionStateTwoTwo: {
- menuBtn: false,
- span: 12,
- column: [{
- label: '堆存地点',
- prop: 'addressId',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '付费对象',
- prop: 'purchaseCompanyId',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },{
- label: '堆存日期',
- prop: 'rentDate',
- width: 100,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }]
- },
- optionState: {},
- formState: {},
- selectionList: [],
- optionStateTwo: {
- menuBtn: false,
- span: 12,
- column: [{
- label: '起租日期',
- prop: 'rentDate',
- width: 100,
- search: true,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }]
- },
- optionStateFour: {
- menuBtn: false,
- span: 12,
- column: [{
- label: '起始日期',
- prop: 'rentStartDate',
- width: 100,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },{
- label: '结束日期',
- prop: 'rentCalculationDate',
- width: 100,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }]
- },
- optionStateThree: {
- menuBtn: false,
- span: 12,
- column: [{
- label: '地点',
- prop: 'addressId',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '退租日期',
- prop: 'rentDate',
- width: 100,
- search: true,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }]
- },
- key: 0,
- checkScheduleDialog: false,
- checkId: '',
- batchNo: '',
- breakConfiguration: {
- multipleChoices: false,
- multiple: false,
- disabled: false,
- searchShow: true,
- collapseTags: false,
- clearable: true,
- placeholder: "请点击右边按钮选择",
- dicData: []
- },
- form: {},
- formTwo: {},
- loading:false,
- search:{},
- optionForm: {
- menuBtn: false,
- span: 6,
- column: [{
- label: '系统号',
- prop: 'sysNo',
- disabled: true
- }, {
- label: '合同号',
- prop: 'contractNo',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '箱数',
- prop: 'boxNumber',
- width: 170,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '客户',
- prop: 'purchaseCompanyId',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '合同生效日期',
- prop: 'effectiveDate',
- type: "date",
- format: "yyyy-MM-dd",
- labelWidth:100,
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '合同失效日期',
- prop: 'expiryDate',
- type: "date",
- format: "yyyy-MM-dd",
- labelWidth:100,
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '备注',
- prop: 'remarks',
- type: 'textarea',
- minRows: 1,
- span: 12
- }]
- },
- option: {},
- storeUp:true,
- optionBack: {
- align: 'center',
- index: true,
- addBtnText: "录入明细",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- searchMenuPosition: "right",
- searchSpan: 8,
- searchIcon: true,
- searchIndex: 2,
- selection: true,
- addRowBtn: false,
- cellBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- height:600,
- dialogWidth: "80%",
- showSummary: true,
- reserveSelection:true,
- sumColumnList: [{
- name: 'emptyWeight',
- type: 'sum',
- decimals: 2
- },{
- name: 'grossWeight',
- type: 'sum',
- decimals: 2
- },{
- name: 'tare',
- type: 'sum',
- decimals: 2
- },{
- name: 'loadingWeight',
- type: 'sum',
- decimals: 2
- },{
- name: 'volume',
- type: 'sum',
- decimals: 2
- }],
- column: [{
- label: '箱号',
- prop: 'code',
- width: 100,
- overHidden: true,
- filterable: true,
- remote: true,
- allowCreate: true,
- search: true,
- type: "select",
- dicUrl: "/api/blade-box-tube/archives/selectArchivesList?size=10¤t=1&code={{key}}",
- props: {
- label: "code",
- value: "code"
- },
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '状态',
- prop: 'status',
- width: 100,
- overHidden: true,
- filterable: true,
- disabled: true,
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_archives_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }, {
- label: '币别',
- prop: 'currency',
- width: 100,
- overHidden: true,
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '租金/天',
- prop: 'price',
- type: 'number',
- controls: false,
- overHidden: true,
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '起租日期',
- prop: 'leaseCommencementDate',
- searchProp: 'leaseCommencementDateList',
- overHidden: true,
- search: true,
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- width: 100,
- }, {
- label: '退租日期',
- prop: 'rentingOutDate',
- searchProp: 'rentingOutDateList',
- overHidden: true,
- search: true,
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- type: "date",
- display: false,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- width: 100,
- }, {
- label: '当前租金期间',
- prop: 'rentEndDate',
- searchProp: 'rentEndDateList',
- overHidden: true,
- search: true,
- searchRange: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- searchLabelWidth:100,
- display: false,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- width: 160
- }, {
- label: '箱类型',
- prop: 'boxTypeId',
- width: 100,
- search: true,
- overHidden: true,
- filterable: true,
- type: 'select',
- props: {
- label: 'name',
- value: 'id'
- },
- dicUrl: '/api/blade-client/container/listMessage',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '最新地点',
- prop: 'address',
- overHidden: true,
- formProp: 'addressId',
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '最新日期',
- prop: 'newDate',
- overHidden: true,
- width: 100,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '堆存状态',
- prop: 'stackingStatus',
- display:false,
- overHidden: true,
- width: 100
- }, {
- label: '堆存时间',
- prop: 'stackingDate',
- width: 100,
- overHidden: true,
- type: "date",
- display:false,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '箱来源',
- prop: 'boxSource',
- width: 100,
- overHidden: true,
- filterable: true,
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '箱状态',
- prop: 'boxStatus',
- width: 100,
- overHidden: true,
- filterable: true,
- search: true,
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '空重(kg)',
- prop: 'emptyWeight',
- type: 'number',
- overHidden: true,
- controls: false,
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '毛重(kg)',
- prop: 'grossWeight',
- type: 'number',
- overHidden: true,
- controls: false,
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '皮重(kg)',
- prop: 'tare',
- overHidden: true,
- type: 'number',
- controls: false,
- width: 100
- }, {
- label: '装载重量(kg)',
- prop: 'loadingWeight',
- type: 'number',
- overHidden: true,
- controls: false,
- width: 100
- }, {
- label: '容积(m³)',
- prop: 'volume',
- type: 'number',
- overHidden: true,
- controls: false,
- width: 100
- }, {
- label: '造箱公司',
- prop: 'boxMakingCompany',
- overHidden: true,
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '造箱日期',
- prop: 'boxMakingDate',
- width: 100,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '箱来源日期',
- prop: 'leaseCommencementDate',
- width: 100,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '箱龄',
- prop: 'boxAge',
- type: 'number',
- controls: false,
- overHidden: true,
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '照片',
- prop: 'tradingBoxFilesList',
- width: 200,
- overHidden: true,
- type: 'upload',
- span: 24,
- listType: 'picture-card',
- tip: '只能上传jpg/png文件,且不超过500kb',
- propsHttp: {
- url: 'link',
- name: 'originalName',
- res: 'data'
- },
- action: '/api/blade-resource/oss/endpoint/put-file'
- }, {
- label: '备注',
- prop: 'remarks',
- overHidden: true,
- type: 'textarea',
- minRows: 3,
- span: 24,
- width: 200
- }]
- },
- dataList: [],
- dataListTwo:[],
- tradingBoxFilesList: [],
- disabled: false,
- disabledVisible: false,
- costData:{},
- // 保存数据的次数
- baocunindex:0
- }
- },
- async created() {
- this.option = await this.getColumnData(this.getColumnName(248.1), this.optionBack);
- selectByName("买箱费").then(res => {
- this.costData = res.data.data
- })
- //下拉箱号带出对应信息
- this.findObject(this.option.column, "code").change = ({value, column}) => {
- selectArchivesList({code: value}).then(res => {
- console.log(res)
- for (let item of res.data.data) {
- if (value == item.code) {
- this.formTwo = {
- boxSource: item.boxSource,
- boxStatus: item.boxStatus,
- emptyWeight: item.emptyWeight,
- grossWeight: item.gorssWeight,
- boxMakingCompany: item.boxMakingCompany,
- boxMakingDate: item.boxMakingDate,
- leaseCommencementDate: item.leaseCommencementDate,
- boxAge: item.boxAge,
- tare: item.tare,
- loadingWeight: item.loadingWeight,
- volume: item.volume,
- }
- }
- }
- })
- }
- this.key++
- if (this.onLoad.id && this.detailData.id) {
- this.refresh(this.onLoad.id,true)
- }else if (this.onLoad.id){
- this.refresh(this.onLoad.id,true)
- }
- },
- methods: {
- //关闭审核
- choceCheckFun() {
- this.checkDialog = false;
- },
- //堆存
- stockpiling() {
- this.title = "堆存"
- const date = new Date();
- this.formState.rentDate = dateFormat(date, "yyyy-MM-dd") + " 00:00:00"
- this.dialogVisible = true
- },
- // 报表
- openReport() {
- this.switchDialog = !this.switchDialog;
- },
- // 报表关闭
- onClose(val) {
- this.switchDialog = val;
- },
- importBox() {
- this.findObject(this.excelOption.column, "excelFile").data = {
- billType: "ZC"
- }
- this.excelBox = true
- },
- derivation() {
- window.open(`/api/blade-box-tube/tradingBoxRent/export-tradingBox-info?${this.website.tokenHeader}=${getToken()}`);
- },
- uploadBefore(file, done, loading) {
- loading = true;
- done();
- },
- uploadAfter(res, done, loading, column) {
- this.excelBox = false;
- if (typeof res.message === "string") return
- for (let item of this.dataList){
- for (let li of res){
- if (item.code === li.code){
- return this.$message.error(`箱号:${item.code}重复!`);
- }
- }
- }
- this.dataList = this.dataList.concat(res)
- this.$message.success("导入成功!");
- this.baocunindex = 1
- loading = false;
- done();
- },
- statusUpdate(status, type) {
- if (this.form.id) {
- this.title = type
- if (type === '起租') {
- this.optionState = this.optionStateTwo
- }else if (type === '退租') {
- this.optionState = this.optionStateThree
- this.formState.rentDate = dateFormat(new Date(), "yyyy-MM-dd") + " 23:59:59"
- } else if (type === '计算租金'){
- this.optionState = this.optionStateFour
- for (let item of this.selectionList) {
- if (!Number(item.price) || Number(item.price) < 0){
- return this.$message.error('租金/天,不能不能为0或不能为负')
- }
- for (let li of this.selectionList) {
- if (item.rentEndDate !== li.rentEndDate) {
- return this.$message.error(`${item.code} - ${item.rentEndDate},当前租金期间不相同,禁止选择`)
- }
- }
- }
- const date = new Date(this.selectionList[0].rentEndDate?this.selectionList[0].rentEndDate:new Date());
- const endDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
- this.formState.rentStartDate = this.selectionList[0].rentEndDate
- this.formState.rentCalculationDate = dateFormat(endDate, "yyyy-MM-dd") + " 23:59:59"
- if (this.selectionList[0].rentEndDate){
- let curDate = new Date(this.selectionList[0].rentEndDate);
- let endDateTime = new Date((curDate/1000+86400)*1000)
- this.formState.rentStartDate = dateFormat(endDateTime, "yyyy-MM-dd") + " 00:00:00"
- const endDateTwo = new Date(endDateTime.getFullYear(), endDateTime.getMonth() + 1, 0);
- this.formState.rentCalculationDate = dateFormat(endDateTwo, "yyyy-MM-dd") + " 23:59:59"
- }
- }else if(type === '撤销租金'){
- return this.$confirm('此操作将撤销租金并删除费用, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- revokeRent({
- ...this.form,
- tradingBoxItemsList:this.selectionList
- }).then(res => {
- this.$message.success("操作成功")
- this.formState = {}
- this.refresh(this.form.id)
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- } else if (type === '撤销退租'){
- return this.$confirm('此操作将撤销退租并删除费用, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- revokeRentingOut({
- ...this.form,
- tradingBoxItemsList:this.selectionList
- }).then(res => {
- this.$message.success("操作成功")
- this.formState = {}
- this.refresh(this.form.id)
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- }else {
- this.optionState = this.optionStateThree
- }
- this.dialogVisible = true
- } else {
- this.$message.error('请保存后操作')
- }
- },
- confirmChange() {
- if (this.title == "堆存") {
- this.$refs["formState"].validate((valid, done) => {
- done()
- if (valid) {
- let data = {
- ...this.form,
- type: "DCF",
- source: "ZC",
- ...this.formState,
- // tradingBoxItemsList: this.dataList,
- tradingBoxItemsList: this.selectionList,
- }
- // data.tradingBoxItemsList.forEach(item=> delete item.id)
- delete data.id
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- generateStack(data).then(res => {
- this.$message.success("生成堆存成功")
- this.baocunindex = 1
- this.dialogVisible = false
- this.disabledVisible = false
- this.formState = {}
- this.selectionList = []
- loading.close();
- this.refresh(this.form.id)
- }).catch(() => {
- loading.close();
- })
- }
- })
- } else {
- this.$refs["formState"].validate((valid, done) => {
- done()
- if (valid) {
- if (this.title === "起租" || this.title === "退租") {
- if (this.title === "退租") {
- if (Number(new Date(this.selectionList[0].rentEndDate)) > Number(new Date(this.formState.rentDate))) {
- return this.$message.error("退租日期不能小于当前租金期间")
- }
- }
- this.disabledVisible = true
- statusUpdate({
- ...this.form,
- ...this.formState,
- tradingBoxItemsList:this.selectionList,
- rentType:this.title === "起租"?1:2
- }).then(res => {
- this.$message.success("操作成功")
- this.dialogVisible = false
- this.disabledVisible = false
- this.formState = {}
- this.refresh(this.form.id)
- }).catch(() => {
- this.disabledVisible = false
- })
- }else {
- if (this.title === "计算租金"){
- if (Number(new Date(this.selectionList[0].leaseCommencementDate)) > Number(new Date(this.formState.rentStartDate))) {
- return this.$message.error("起始日期不能小于起租日期")
- }
- this.disabledVisible = true
- calculateRent({
- ...this.form,
- ...this.formState,
- tradingBoxItemsList:this.selectionList
- }).then(res => {
- this.$message.success("操作成功")
- this.dialogVisible = false
- this.disabledVisible = false
- this.formState = {}
- this.refresh(this.form.id)
- }).catch(() => {
- this.disabledVisible = false
- })
- }
- }
- }
- })
- }
- },
- selectionChange(list) {
- this.selectionList = list
- for (let item of list){
- if (item.status == '待使用' && item.stockpilingStatus == '1'){
- this.storeUp = false
- }else {
- return this.storeUp = true
- }
- }
- },
- confirmEdit() {
- if (this.form.status > 0) {
- //基础资料
- this.$set(this.optionForm, "disabled", true)
- //箱信息
- // this.$set(this.option, "disabled", true)
- this.$set(this.option, "addBtn", false)
- this.$set(this.option, "menu", false)
- //费用信息
- this.$set(this.$refs.boxCost.option, "disabled", true)
- this.$set(this.$refs.boxCost.option,"addBtn",false)
- this.$set(this.$refs.boxCost.option,"menu",false)
- //附件和顶部按钮
- this.disabled = true
- } else {
- //基础资料
- this.$set(this.optionForm, "disabled", false)
- //箱信息
- this.$set(this.option, "disabled", false)
- // this.$set(this.option, "addBtn", true)
- this.$set(this.option, "menu", true)
- //费用信息
- this.$set(this.$refs.boxCost.option,"disabled",false)
- // this.$set(this.$refs.boxCost.option,"addBtn",true)
- this.$set(this.$refs.boxCost.option,"menu",true)
- //附件和顶部按钮
- this.disabled = false
- }
- this.key++
- },
- // 明细删除
- rowDel(row, index, type) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- tradingBoxItem(row.id).then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!");
- this.dataList.splice(index, 1);
- if (this.dataListTwo.length > 0) {
- for (let item in this.dataListTwo) {
- if (this.dataListTwo[item].code == row.code) {
- if (this.dataListTwo[item].autoGenerate == 1) {
- if (this.dataListTwo[item].id) {
- tradingBoxFees(this.dataListTwo[item].id).then(res => {
- if (res.data.success) {
- this.dataListTwo.splice(index, 1);
- }
- });
- } else {
- this.dataListTwo.splice(Number(item), 1);
- }
- }
- }
- }
- }
- }
- });
- } else {
- this.dataList.splice(index, 1);
- this.$message.success("操作成功!");
- if (this.dataListTwo.length > 0) {
- for (let item in this.dataListTwo) {
- if (this.dataListTwo[item].code == row.code) {
- if (this.dataListTwo[item].autoGenerate == 1) {
- this.dataListTwo.splice(Number(item), 1);
- }
- }
- }
- }
- }
- }
- )
- ;
- },
- balabala(row,type) {
- this[type[0]][type[1]] = row.name
- },
- //撤销
- repealCancel(){
- this.$confirm("您确定撤回此次申请吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- const data = {
- id : this.form.id,
- pageLabel:"租出",
- checkFlag: 4,
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- repealCancel(data).then(res => {
- loading.close();
- this.$message.success('撤回成功')
- this.refresh(this.form.id)
- }).catch(()=>{
- loading.close();
- })
- })
- },
- // 请核
- pleaseCheck() {
- this.$confirm("您确定提交请核申请吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$refs["form"].validate((valid,done) => {
- done()
- if (valid) {
- if (this.dataList.length === 0) {
- return this.$message.error("箱信息不能为空")
- }
- if (this.$refs.boxCost.dataList.length === 0) {
- return this.$message.error("费用信息不能为空")
- }else {
- for (let item of this.$refs.boxCost.dataList){
- if (!item.id){
- return this.$message.error("费用信息未保存")
- }
- }
- }
- let data = {
- ...this.form,
- tradingBoxItemsList: this.dataList,
- tradingBoxFeesList: this.dataListTwo,
- tradingBoxFilesList: this.tradingBoxFilesList,
- type: "ZC"
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit(data).then(res => {
- const data = {
- id: res.data.data.id,
- url: '/boxManagement/buyContainer/index',
- pageStatus: "this.$store.getters.domSaleStatus",
- pageLabel: "租出",
- checkFlag: 4,
- }
- pleaseCheck({
- ...data,
- type: "ZC"
- }).then(rest => {
- loading.close();
- this.$message.success('请核成功')
- this.refresh(res.data.data.id)
- }).catch(()=>{
- loading.close();
- })
- }).catch(()=>{
- loading.close();
- })
- }
- });
- })
- },
- //审核关闭
- choceScheduleFun(){
- this.checkScheduleDialog = false
- },
- resetChange(item){
- this.queryDetails()
- },
- searchChange(params, done) {
- for (let item of this.dataList){
- if (!item.id){
- this.$confirm('有未保存明细继续搜索会清空未保存数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- done();
- return this.queryDetails(params)
- })
- }
- }
- done();
- this.queryDetails(params)
- },
- // 箱信息的分页
- xiangpage(page,params = {}){
- this.queryDetails()
- },
- // 获取箱信息数据
- queryDetails(params = {}) {
- params = {
- ...params,
- current: this.page.currentPage,
- size: this.page.pageSize,
- type: "ZC",
- ...Object.assign(params, this.search)
- }
- this.loading = true
- detList({
- ...params,
- pid:this.form.id?this.form.id:this.onLoad.id
- }).then(res=>{
- this.page.total = res.data.data.total
- this.dataList = res.data.data.records
- this.loading = false
- }).finally(() => {
- this.loading = false
- }).catch(()=>{
- this.loading = false
- })
- },
- refresh(id,type) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- detail({id: id}).then(res => {
- this.form = res.data.data
- this.dataList = res.data.data.tradingBoxItemsList
- this.dataListTwo = res.data.data.tradingBoxFeesList
- this.tradingBoxFilesList = res.data.data.tradingBoxFilesList
- delete this.form.tradingBoxItemsList
- delete this.form.tradingBoxFeesList
- delete this.form.tradingBoxFilesList
- this.$refs.boxCost.code = this.form.code
- loading.close();
- if (type) {
- //基础资料
- this.$set(this.optionForm, "disabled", true)
- //箱信息
- // this.$set(this.option, "disabled", true)
- this.$set(this.option, "addBtn", false)
- this.$set(this.option, "menu", false)
- //费用信息
- this.$set(this.$refs.boxCost.option, "disabled", true)
- this.$set(this.$refs.boxCost.option, "addBtn", false)
- this.$set(this.$refs.boxCost.option, "menu", false)
- //附件和顶部按钮
- this.disabled = true
- }else {
- if (this.form.status > 0) {
- //基础资料
- this.$set(this.optionForm, "disabled", true)
- //箱信息
- // this.$set(this.option, "disabled", true)
- this.$set(this.option, "addBtn", false)
- this.$set(this.option, "menu", false)
- //费用信息
- this.$set(this.$refs.boxCost.option, "disabled", true)
- this.$set(this.$refs.boxCost.option, "addBtn", false)
- this.$set(this.$refs.boxCost.option,"menu",false)
- //附件和顶部按钮
- this.disabled = true
- } else {
- //基础资料
- this.$set(this.optionForm, "disabled", false)
- //箱信息
- this.$set(this.option, "disabled", false)
- // this.$set(this.option, "addBtn", true)
- this.$set(this.option, "menu", true)
- //费用信息
- this.$set(this.$refs.boxCost.option, "disabled", false)
- // this.$set(this.$refs.boxCost.option, "addBtn", true)
- this.$set(this.$refs.boxCost.option, "menu", true)
- //附件和顶部按钮
- this.disabled = false
- }
- }
- this.key++
- })
- },
- //新增修改
- editCustomer() {
- this.$refs["form"].validate((valid,done) => {
- done()
- if (valid) {
- let data = {
- ...this.form,
- // tradingBoxItemsList: this.dataList,
- // tradingBoxFeesList: this.dataListTwo,
- tradingBoxFilesList: this.tradingBoxFilesList,
- type: "ZC"
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit(data).then(res => {
- if (this.form.id) {
- this.$message.success("修改成功")
- } else {
- this.$message.success("新增成功")
- }
- this.baocunindex = 0
- loading.close();
- this.refresh(res.data.data.id)
- }).catch(()=>{
- loading.close();
- })
- }
- });
- },
- // 箱信息添加
- rowaddfun(){
- this.$refs["form"].validate((valid,done) => {
- if (valid) {
- const idp = this.form.id?this.form.id:this.onLoad.id
- if (!idp) {
- return this.$message.warning('请先填写保存数据');
- }else {
- this.$refs.crud.rowAdd()
- }
- }else {
- return this.$message.warning('请先填写基础信息');
- }
- })
- },
- // 箱信息添加确认
- rowSave(form,done,loading) {
- let result = this.dataList.some((item) => {
- if (item.code == form.code) {
- return true
- }
- })
- if (result === true) {
- this.$message.error("已存在此箱号");
- return loading();
- }
- form.boxType = form.$boxTypeId
- this.tradingBoxItemSubmitRentfun(form)
- // 费用的保存
- const obj = {
- // 费用名称id
- itemId:'1636526426121347073',
- itemName: "租金",
- // 客户id
- corpId:this.form.purchaseCompanyId,
- corpName: this.form.purchaseCompanyName,
- // 排序
- sort:1,
- // 数量
- quantity:1,
- // 单价
- price:form.amount,
- // 金额
- amount: form.amount,
- // 币别
- currency:form.currency,
- // 1.应收 2.应付
- feesType: 1,
- // 箱号
- code: form.code,
- // 业务类型
- billType: "",
- // 是否自动生成(0否1是)
- autoGenerate:1,
- // 是否手动录入
- identifier:0,
- pid: form.pid,
- remarks:form.remarks,
- }
- this.$refs.boxCost.data_one.push(obj)
- this.$refs.boxCost.tradingBoxFeesSubmitfun(obj)
- done(form)
- },
- // 箱编辑弹窗接口
- xiangbianji(row,index){
- // 暂存箱号
- this.ZCcode = row.code
- this.$refs.crud.rowEdit(row,index)
- },
- // 箱信息编辑弹窗确认按钮
- rowUpdate(form, index, done, loading) {
- form.boxType = form.$boxTypeId
- this.tradingBoxItemSubmitRentfun(form)
- // 费用的更改
- for(let index in this.$refs.boxCost.data_one) {
- if (this.ZCcode == this.$refs.boxCost.data_one[index].code){
- this.$refs.boxCost.data_one[index] = {
- id:this.$refs.boxCost.data_one[index].id,
- // 费用名称id
- itemId:'1636526426121347073',
- itemName: "租金",
- // 客户id
- corpId:this.form.purchaseCompanyId,
- corpName: this.form.purchaseCompanyName,
- // 排序
- sort:1,
- // 数量
- quantity:1,
- // 单价
- price:form.amount,
- // 金额
- amount: form.amount,
- // 币别
- currency:form.currency,
- // 1.应收 2.应付
- feesType: 1,
- // 箱号
- code: form.code,
- // 业务类型
- billType: "",
- // 是否自动生成(0否1是)
- autoGenerate:1,
- // 是否手动录入
- identifier:0,
- pid: form.pid,
- remarks:form.remarks,
- }
- this.$refs.boxCost.tradingBoxFeesSubmitfun(this.$refs.boxCost.data_one[index])
- break;
- }
- }
- done(form)
- },
- // 箱信息的保存和添加
- tradingBoxItemSubmitRentfun(form){
- tradingBoxItemSubmitRent({
- ...form,
- pid:this.form.id?this.form.id:this.onLoad.id
- }).then(res=>{
- this.$message.success("操作成功!");
- this.baocunindex = 1
- this.queryDetails()
- })
- },
- //打开表单前
- beforeOpen(done,type){
- if (this.formTwo.count > 0){
- this.findObject(this.option.column, "price").disabled = true
- // this.findObject(this.option.column, "amount").disabled = true
- }else {
- this.findObject(this.option.column, "price").disabled = false
- // this.findObject(this.option.column, "amount").disabled = false
- }
- if(['view','edit'].includes(type)){
- itemDetails({id:this.formTwo.id,type: "ZC"}).then(res=>{
- if (this.formTwo.tradingBoxFilesList.length === 0){
- this.formTwo.tradingBoxFilesList = res.data.data.tradingBoxFilesList
- }
- })
- // 查看和编辑逻辑
- }
- done();
- },
- //删除图片
- uploadDelete(file, column) {
- return new Promise((resolve, reject) => {
- this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- if (this.formTwo.tradingBoxFilesList[file.uid].id) {
- tradingBoxFiles(this.formTwo.tradingBoxFilesList[file.uid].id).then(res => {
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- resolve();
- })
- } else {
- resolve();
- }
- }).catch(()=>{
- reject();
- this.$message({
- type: "info",
- message: "已取消删除"
- });
- })
- })
- },
- getGSData(row,type) {
- this[type[0]][type[1]] = row.cname
- },
- backToList(type) {
- if (type == 0){
- console.log(this.baocunindex,1246)
- if (this.baocunindex != 0) {
- return this.$message.warning('请先填写保存数据');
- }
- if (this.detailData.id){
- this.$router.push({
- path: '/boxManagement/buyContainer/index'
- });
- }
- this.$emit("backToList",type);
- }else if (type == 1){
- this.$router.push({
- path: '/approveData/index'
- });
- this.$emit("backToList",type);
- }
- },
- //自定义列保存
- 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.$nextTick(() => {
- this.$refs.crud.doLayout()
- })
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- resetTrigger(){
- if (this.optionForm.disabled == true) {
- if (this.form.status > 0) {
- //基础资料
- this.$set(this.optionForm, "disabled", true)
- //箱信息
- // this.$set(this.option, "disabled", true)
- this.$set(this.option, "addBtn", false)
- this.$set(this.option, "menu", false)
- //费用信息
- this.$set(this.$refs.boxCost.option, "disabled", true)
- this.$set(this.$refs.boxCost.option, "addBtn", false)
- this.$set(this.$refs.boxCost.option,"menu",false)
- //附件和顶部按钮
- this.disabled = true
- } else {
- //基础资料
- this.$set(this.optionForm, "disabled", false)
- //箱信息
- this.$set(this.option, "disabled", false)
- // this.$set(this.option, "addBtn", true)
- this.$set(this.option, "menu", true)
- //费用信息
- this.$set(this.$refs.boxCost.option, "disabled", false)
- // this.$set(this.$refs.boxCost.option, "addBtn", true)
- this.$set(this.$refs.boxCost.option, "menu", true)
- //附件和顶部按钮
- this.disabled = false
- }
- }else {
- //基础资料
- this.$set(this.optionForm, "disabled", false)
- //箱信息
- this.$set(this.option, "disabled", false)
- // this.$set(this.option, "addBtn", true)
- this.$set(this.option, "menu", true)
- //费用信息
- this.$set(this.$refs.boxCost.option, "disabled", false)
- // this.$set(this.$refs.boxCost.option, "addBtn", true)
- this.$set(this.$refs.boxCost.option, "menu", true)
- //附件和顶部按钮
- this.disabled = false
- }
- this.$nextTick(() => {
- this.$refs.crud.doLayout()
- })
- this.key++
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.resetTrigger()
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- }
- }
- }
- </script>
- <style scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px;
- }
- </style>
|